应用程序中包含的数据库
我在 c#on Visual Studio 中有一个 winform 应用程序,连接到 sql server 2008 中的数据库,并且我已经对其进行了部署,因此要使用它,我必须安装 sql server management studio 并恢复数据库备份,所以我什么时候可以进行部署和设置项目包括或进行数据库备份,无需在 PC 上安装 SQL Server Management Studio 使用此应用程序,并且从该应用程序中,我将从具有新记录的更新数据库中进行备份 那么,我如何制作一个部署和设置项目并将所使用的数据库嵌入其中,这样我就不需要在充当服务器和客户端PC的PC中安装sql服务器,因为我想在一个应用程序中使用该应用程序网络?
i have a winform application in c#on visual studio, connected to a database in sql server 2008 and i have done a deployment to it so to use it i must install the sql server management studio and restore the database backup, so Can i when doing the deployment and setup project include or take the database backup to not need to install the SQL server management studio on the PC use this application and from the application i will take a backup from the updated database which has new records
So how do i make a deployment and setup project and embedded in it the database used so i'll not be needed to install the sql server in the PC which act as a server and the clients PCs as i want to use the application in a network?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您的数据库很琐碎,应该可以从一台计算机访问并用于存储本地数据查找。
http://www.microsoft.com/sqlserver/2008/en/us /compact.aspx。当然,您需要阅读有关如何使用和部署它的其他文章,但这应该是一个起点。注意:您将没有存储过程和高级 SQL Server 功能,但您将使用与现在相同的代码。
If your database is trivial, should be accessible from a single computer and is used to store local data look to the.
http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx. For sure you will need to read additional articles about how to use it and deploy it, but this should be a starting point. NOTE: you will not have stored procedures and advanced SQL Server features, but you will use the same code as you do now.
请注意,如果要将数据库从备份还原到任意 SQL Server 实例,并且要还原备份的实例配置的选项与原始 SQL Server 实例不同(例如,排序规则、大小写),则可能会遇到问题。 - 灵敏度、ANSI 设置等)如果默认排序规则不同,例如,您可能会遇到索引问题。
Note that if you want to restored a database from backup to an arbitrary SQL Server instance, you may encounter problems if the instance to which the backup is being restored is configured with options different than the original SQL Server instance (e.g., collation sequence, case-sensitivity, ANSI settings, etc.) If the default collation sequence is different, you may have problems with indices, for instance.
您可以使用 sqlcmd 来实现此目的,它与 MSSQL 服务器一起安装在客户端计算机上 查看此处了解详细信息。
创建bat文件后,您可以使用Process.Start从代码中运行它
You can use sqlcmd for that, it installs with MSSQL server on client machine look here for details.
After you created bat file, you can run it from code use Process.Start
程序运行不需要安装 SQL Management Studio,而是必须安装 SQLServer。
对于小型应用程序来说,管理 SQLServer 可能会需要很多工作,在这种情况下最好使用其他数据库类型...我以前使用 XML 文件,最近我使用 Sqlite,它非常好,无需安装。并且它很好地集成到 Visual Studio 中。
编辑:如果您只需要恢复 .bak,您可以使用 http://sqlbackupandftp。 com/restore/ 它非常好用且简单,而且文件非常小。
It's not the SQL Management Studio that is needed to be installed to make the program work, it's SQLServer that must be installed.
For small applications it maybe to much of work to administrate a SQLServer, in that case its better to use other database types... I used to use XML files, lately I use Sqlite, its very good no installation required. and it integrates great into Visual Studio.
Edit: If you only need to restore a .bak you could use that http://sqlbackupandftp.com/restore/ its very nice and easy, and its a very small file.