SQL connection in UWP app

前端 未结 2 1699
一向
一向 2020-12-22 00:41

I have am existing project that runs on windows, mac, ios and android. I\'m looking for a way to make a windows phone version, but I can\'t figure out how to use SQL. My cur

相关标签:
2条回答
  • 2020-12-22 00:51

    If you want to connect a local database, for example the SQLite, there are implemented libraries could be used do this stuff:

    A Developer's Guide to Windows 10: (10) SQLite Local Database

    If you want to connect a server-based database, for example, the SQL Server database, unfortunately, there is not a built-in API like ADO.NET that could be used to connect the SQL Server directly. And for a workaround, you would have to utilize a middle layer for example, the WCF Serrvie:

    How to access data from SQL Server database in Windows Store app, although this sample is written for store app, the used approach is the same for UWP application.

    0 讨论(0)
  • 2020-12-22 01:05

    You'll not be able to connect directly to a Microsoft SQL Server database. Instead you'll need to make some type of Service layer that communicates with the database and your phone app would need to communicate with that. For more information on how to do that see the code same and the video that Microsoft has hosted here:

    https://code.msdn.microsoft.com/windowsapps/How-to-access-data-from-5f2602ec

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