如何使用我的项目部署数据库?

时间:2022-06-01 21:58:45

I have a Windows mobile project an have added a small sqlite database to it. I have set the "Copy to Output Directory" on the db file to "Copy Always". But how do I get the database to be deployed with the project?

我有一个Windows移动项目,它已经添加了一个小的sqlite数据库。我已将db文件中的“复制到输出目录”设置为“始终复制”。但是如何让数据库与项目一起部署?

1 个解决方案

#1


If you mean "how do I get Visual Studio to deploy the file when I hit F5" then you need to set the "Build Action" to "Content". If you mean "How do I deploy the database to end users along with my application" then the answer is that you need to include the database file in your application deployment CAB.

如果您的意思是“当我点击F5时如何让Visual Studio部署文件”,那么您需要将“Build Action”设置为“Content”。如果您的意思是“如何将数据库与我的应用程序一起部署到最终用户”,那么答案是您需要在应用程序部署CAB中包含数据库文件。

#1


If you mean "how do I get Visual Studio to deploy the file when I hit F5" then you need to set the "Build Action" to "Content". If you mean "How do I deploy the database to end users along with my application" then the answer is that you need to include the database file in your application deployment CAB.

如果您的意思是“当我点击F5时如何让Visual Studio部署文件”,那么您需要将“Build Action”设置为“Content”。如果您的意思是“如何将数据库与我的应用程序一起部署到最终用户”,那么答案是您需要在应用程序部署CAB中包含数据库文件。