Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 current code base is very large and I can't "switch" to using EF. How can I get access to databases in UWP?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
939 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...