如何使用MsBuild创建可移植数据库? [英] How do you create portable databases with MsBuild?

查看:81
本文介绍了如何使用MsBuild创建可移植数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的解决方案中存储一个包含数据库创建脚本的项目. 构建此项目时,它必须生成一个数据库文件,然后该文件将在运行时供解决方案的此项目和其他项目使用. 该怎么做?

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:

  • 哪个命令行可以帮助我(也许sqlite有一个命令行客户端?)
  • 是否需要在运行脚本之前创建一个空的数据库文件?

推荐答案

您可以从 http://www.sqlite.org/download.html

然后,您可以添加以下预构建任务:

Then you can add the following Pre-Build task:

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

这篇关于如何使用MsBuild创建可移植数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆