18

我试图在 WinRT 中找到一个 API,它允许我创建一个本地数据库,该数据库可用于存储偶尔连接的应用程序的数据。我正在寻找类似 SQL Compact Edition 的东西。

我在各种板上看到了各种消息,表明要么

  • (a) 将不会是任何本地数据库
  • (b) 没有本地“服务器”数据库(即 SQL Express 类型的实例)
  • (c) 名为“Jet Blue”的本地数据库代码。

有人对此有明确的答案吗?如果这条路被堵住了,我不想从这条路开始。

4

6 回答 6

6

现在正式支持 SQLite。有关详细信息,请参阅Tim Heuer 的博客。对于具有较少数据的更简单的解决方案,您可以使用http://winrtdatabase.codeplex.com/

于 2012-06-29T02:33:35.507 回答
4

您可能想看看SQLite3-WinRT ,这是我们编写的SQLite包装器,用于在 Metro 风格的应用程序中使用它。它包含一个仅使用 WinRT 兼容 API 的 SQLite 版本,以及一个用于在 C# 和 JavaScript 应用程序中使用它的 WinRT 组件。

于 2012-05-02T13:06:20.493 回答
3

There is no SQL CE available for Metro.

a) will be no local databases whatsoever

This is not true. SQLite should be able to run on WinRT. You can download the code here and include the two main files into your WinRT project. To compile and pass certification you will need to make sure you are using the correct WinRT replacement calls for the Win32 calls that are not supported. The 3rd party solution Bob mentioned is a WinRT wrapper it doesn't include changes to SQLite to pass certification.

(b) no local "server" databases (i.e. SQL Express type instances)

It seems unlikely there will be SQL Express for metro.

(c) A local database code named "Jet Blue".

If you mean Microsoft Jet Database engine, yes that seems to be supported but I would rather use SQLite.

Also remember if you are using HTML/JS you have the option of using IndexedDB

于 2012-02-18T23:50:42.150 回答
0

有第 3 方解决方案出现或已经出现。CodePlex 有一个——http: //sqlwinrt.codeplex.com/

另一个需要您做一些工作的选项是通过 Web 服务代理您的数据库访问。

于 2012-02-18T17:56:14.033 回答
0

根据此
http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-930C没有(内置)数据库

于 2012-02-18T17:59:06.867 回答
0

您真的需要“为偶尔连接的应用程序存储数据”吗?这对我来说听起来有点矫枉过正。为什么不序列化数据(各种选项)来存储自己?

于 2012-02-20T10:01:59.453 回答