有没有比使用应用程序部署数据库更好的方法

问题描述:

大家好,

我制作了一个小型WPF应用程序,其中包含一个小型数据库(5个表,共几千个数据位),目前我的计划是在安装了该程序的每台计算机上,将该应用程序与数据库一起部署.我想不出更好的方法来完成此操作,因为每个用户都可以访问他们认为合适的数据库.我不希望一个人的数据弄乱另一个人的数据.有没有更好的方法可以做到这一点,或者这是唯一的方法吗?

Dan

Hi all,

I have made a small WPF application that contains a small database (5 tables a couple of 000''s bits of data), currently my plan is to deploy the db with the application on each computer it get''s installed on. I can''t think of a better way to do this as each user will have access to change the database as they see fit. I don''t want one person''s data messing up another person''s. Is there a better way of doing this or is this the only way?

Dan

取决于您计划使用的数据库系统,这可能是最好的方法.
如果使用MySQL或MsSQL,则不会-不好的主意.
如果您使用SqLite或SqlCE,则可以-不错的主意.我没有SqLite的经验,但是SqlCE是一个独立的MsSQL简化版本,旨在用于单用户应用程序,并且除了.NET所需的安装外,不需要任何安装.
Depending on the database system you are planning to use, it may be the best way.
If you use MySQL or MsSQL, then no - bad idea.
If you use SqLite or SqlCE then yes - good idea. I don''t have experience with SqLite, but SqlCE is a stand alone, cut down version of MsSQL which is intended for single user applications, and requires no installation other than that which is needed for .NET anyway.


您可以将数据库脚本化为sql文件,然后让安装程序(或用户)shell执行该sql文件.当然,必须在系统上安装SQL Server才能起作用.
You can script the the database to a sql file, and then have the installer (or the user) shellexecute the sql file. Of course, SQL Server must be installed on the system for that to work.