Sql Server Compact Edition 数据库部署策略
我有一个关于使用我们的客户端应用程序部署 SQL Server CE 数据库的最合适方法的问题。我知道我们需要安装 SQL Server CE 先决条件等,所以这不是让它工作的问题。已经是这样了。
现在我们的方式是,我们只随应用程序发送 .mdf 文件的副本(不包含数据),该副本在安装过程中被复制到适当的位置。这工作得很好,但我想知道这是否是使用应用程序部署数据库的“正确”方法,或者数据库是否应该 a.) 在安装过程中生成(作为自定义安装操作),或者 b.)首次运行应用程序时生成。
任何想法或建议表示赞赏。我意识到这个问题可能没有可靠的答案。
I have a question about the most appropriate way to deploy a SQL Server CE database with our client application. I understand we need to install the SQL Server CE prerequisites etc., so this isn't a question about getting it to work. It already does.
Right now the way we have it is that we just ship a copy of the .mdf file (containing no data) with the application, which gets copied to the appropriate location during installation. This works perfectly fine, but I was wondering if this is the "correct" method of deploying a database with an application or if the database should be either a.) generated during the installation (as a custom install action), or b.) generated at the first run of the application.
Any thoughts or suggestions are appreciated. I realize there probably isn't a solid answer to this question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里讨论的是*.mdf文件,而不是如何确保SqlServerCE dll可用。
如何部署数据库应用程序很大程度上取决于以下问题:
数据库是针对每个用户的吗?
如果没有,那么简单地包含一个初始文件就可以正常工作,并且是最简单的选择。
数据库一开始是空的吗(即,您可以“在代码中创建表结构,并且在任何地方都没有 *.mdf 文件作为其基础。
如果有重要数据,那么这几乎肯定会排除
更改数据库初始状态中的重要数据?
如果是这样,那么您可能希望该文件是单独的而不是作为嵌入式资源。
This is talking about the *.mdf file, not how to ensure that the SqlServerCE dll is available.
How you should deploy the database application is strongly dependent on the following questions:
Is the database per user?
If not then simply including a single initial file will work fine and is the simplest option.
Is the database empty to start with (i.e.e you could 'create the table structure in code and have no *.mdf file anywhere to base it off.
If there is significant data then this almost certainly precludes the embedded option.
Is there significant data in the initial state of the database that you may want to change without changing the dll?
If so then you will likely want the file separate rather than as an embedded resource.
请参阅此
使用应用程序部署 SQL Server Compact Edition 数据库
http://www.tomshardware.com/forum/18893- 36-deploy-server
再见。
See this
Deploy a SQL Server Compact Edition Database with an Application
http://www.tomshardware.com/forum/18893-36-deploy-server
Bye.