How do you create portable databases with MsBuild?

匆匆过客 提交于 2019-12-07 11:49:36

问题


I want to store in my solution a project containing the database creation scripts. When this project is built, it must generate a database file, which will then be used by this and other projects of the solution at the run time. How to do that?

I know I can add Pre-Build task, but I wonder:

  • which command line can help me (maybe sqlite has a command line client?)
  • will it need that I create an empty database file before running the scripts?

回答1:


You can download the command line client shell for SQLite at http://www.sqlite.org/download.html

Then you can add the following Pre-Build task:

"sqlite3.exe" %dbFilename% < Database.sql



回答2:


try Access db(extension: accdb)...its easy to edit and can be backed up and used with Office access..as well.also its portable..



来源:https://stackoverflow.com/questions/4995597/how-do-you-create-portable-databases-with-msbuild

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!