如何将 SqlCe 数据库部署到 Windows 手机的isolatedStorage [英] How to deploy SqlCe Database into isolatedStorage for windows phone
问题描述
比如说,我想使用一个现有的 SqlCe 数据库,其中包含数据.我不确定哪种方法最好.
1) 这里是为 Windows 手机创建 SqlCe 数据库的正常方法
<前>使用 (CountryDataContext context = new CountryDataContext(ConnectionString)){如果 (!context.DatabaseExists()){//如果数据库不存在则创建context.CreateDatabase();}}但是这个数据库里面有数据,所以我不想创建它.我想部署或存储在isolatedStorage中.
我该怎么做??我想使用数据库中已有的数据.
谢谢
您可以将数据库文件作为内容包含在您的应用程序项目中,然后它将在构建时放入您的 XAP 并复制到您的应用程序安装目录中电话.
你会修改这个数据库吗?
say, I want to use an existing SqlCe Database which HAS data in it. I am not sure which is the best way to do it.
1) here is the normal way to create a SqlCe Database for Windows phone
using (CountryDataContext context = new CountryDataContext(ConnectionString)) { if (!context.DatabaseExists()) { // create database if it does not exist context.CreateDatabase(); } }
But this Database has data in it , so I dont want to create it. I want to deploy it or store in in isolatedStorage.
How should I do it ?? I want to use the data already in the database.
Thanks
You can include the database file as Content in your application project and it will then be put in your XAP at build time and copied to your application install directory on the phone.
Will you modify this database at all?
这篇关于如何将 SqlCe 数据库部署到 Windows 手机的isolatedStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!