UWP 应用中的 SQL 连接 [英] SQL connection in UWP app

查看:29
本文介绍了UWP 应用中的 SQL 连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 windows、mac、ios 和 android 上运行的现有项目.我正在寻找一种制作 Windows 手机版本的方法,但我不知道如何使用 SQL.我当前的代码库非常大,我无法切换"到使用 EF.如何在 UWP 中访问数据库?

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?

推荐答案

如果要连接本地数据库,例如 SQLite,可以使用实现的库来做这些:

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

Windows 10 开发人员指南:(10)SQLite 本地数据库

如果您想连接基于服务器的数据库,例如 SQL Server 数据库,不幸的是,没有像 ADO.NET 这样的内置 API 可用于直接连接 SQL Server.对于解决方法,您必须使用中间层,例如 WCF Servvie:

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:

如何在 Windows 中访问 SQL Server 数据库中的数据商店应用,虽然本示例是为商店应用编写的,但使用的方法与UWP应用相同.

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.

这篇关于UWP 应用中的 SQL 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆