开发者

Database included in an application

开发者 https://www.devze.com 2023-03-05 16:23 出处:网络
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 resto

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 emb开发者_JAVA百科edded 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?


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.


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消