简体   繁体   English

WP7数据存储—大量数据

[英]WP7 Data Storage— lots of data

I am going to be creating a WP7 app that needs to store a decent amount of data. 我将要创建一个需要存储大量数据的WP7应用程序。 Specifically, blocks of text (short article length), and more than 50-500 at any one time. 具体来说,是一小段文字(文章长度短),并且每次都超过50-500。

I am a PHP guy, so I would use MySQL if I were doing this on a server, so is there an equivalent database system or data storage system for WP7 that can handle this amount of text? 我是一个PHP专家,所以如果我在服务器上执行此操作,我将使用MySQL,那么WP7是否有一个等效的数据库系统或数据存储系统可以处理大量文本? Would IsolatedStorage be ok for this, or do I have to use something else? 隔离存储是否可以解决此问题,还是我必须使用其他东西?

It doesn't have to be SQL, just something that can handle lots of data. 它不必是SQL,而只是可以处理大量数据的东西。 I just used MySQL as an example because it would be (my) ideal choice if this were a server. 我只是以MySQL为例,因为如果这是一台服务器,那将是我的理想选择。

I recommend using LINQ To XML and storing the XML files in isolated storage. 我建议使用LINQ To XML并将XML文件存储在隔离的存储中。 The technology is great. 技术很棒。 It has intellisense in VS and the syntax is similar to SQL so you should be able to pick it up easily. 它在VS中具有智能感知功能,其语法与SQL相似,因此您应该可以轻松地将其掌握。 Ive used this for a similar scenario like yours and the performance was good. 我已经将其用于类似您的情况,并且性能良好。

Here is a link to a sample to help you get started: 以下是示例链接,可帮助您入门:

LINQ TO XML Sample LINQ TO XML示例

The nice thing is once you learn this you can use it when reading web services, writing to xml files, updating etc. Let me know if this helps. 有趣的是,一旦您了解了这一点,就可以在阅读Web服务,写入xml文件,更新等内容时使用它。让我知道是否有帮助。

Update: With mango we now have access to SQL Server Compact. 更新:使用芒果,我们现在可以访问SQL Server Compact。 All the info is at MSDN . 所有信息都在MSDN上

There are currently lots of databases which support Windows Phone 7. See the list at: Local Sql database support for Windows phone 7 当前有很多支持Windows Phone 7的数据库。请参阅以下列表:Windows Phone 7的本地Sql数据库支持

You don't have to use a database though if flat files would be more appropriate. 如果平面文件更合适,则不必使用数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM