How do I interact with SQL in a Windows Store App

前端 未结 3 1433
离开以前
离开以前 2021-01-21 06:55

I\'ve been asked to begin developing a Windows Store version of our company\'s LOB web application. What\'s the best way to go about interacting with out data store?

My

相关标签:
3条回答
  • 2021-01-21 07:09

    If you want local database you can use SQLite but I'm guesing that you want external Db

    One of my apps is connecting via web with DB. The DB is in Azure. I connect them by simple .net webapi. So my Windows Store App is getting data via webapi from Azure db via HttpClient. It's easy to do. 3 lines of code. I'm sending data as a JSON serialized string sa they take minimum space. It's a good way but you need to remember that when you want to use big objects etc you need to think about caching results, checking the cache, cleaning it etc.

    0 讨论(0)
  • 2021-01-21 07:25

    XAML is a declarative language based on XML, javascript is a scripting language. I'd suggest reading some basics first before you dive in.

    And yes, you can use C# to communicate with remote servers and/or webservices...

    Maybe this will help: http://msdn.microsoft.com/en-us/library/windows/apps/hh974581.aspx

    0 讨论(0)
  • 2021-01-21 07:26

    You can accomplish it with C# or JavaScript and you'd do it pretty much the same way, via services. Windows Store (C#/VB) applications don't have the same capabilities as desktop apps do to access databases via interfaces like ODBC, JDBC, SQL Native Client, etc., so you won't be connecting your Win RT app with SQL, you'll be connecting it via a hosted service that itself directly accesses the database.

    Depending on how your LOB web application is partitioned, you may be able to expose existing functionality as a service layer and then invoke those services from your Windows Store app via HTTP requests. The HttpClient sample should help and depending on the service implementation you can also use WCF client capabilities in Windows Store apps.

    0 讨论(0)
提交回复
热议问题