Question

BilelGh on Tue, 28 Jul 2015 23:17:29


i have a c# winform app with  2012 sql server database and i want to install it into other pc client so please can you tell me how to make an installer for my app and how to install the database into pc client and how to change the connection string in my app ? thank you very much

Sponsored



Replies

Daniel Janik on Tue, 28 Jul 2015 23:43:36


i have a c# winform app with  2012 sql server database and i want to install it into other pc client so please can you tell me how to make an installer for my app and how to install the database into pc client and how to change the connection string in my app ? thank you very much

There are a few things to consider:

  1. SQL Server is a server - client application. Databases live on a server and clients connect to it.
  2. The client can be the same machine as the server.
  3. SQL standard and higher require licensing that is not free. SQL Express is free and can be deployed without additional licensing.
  4. Deploying a database requires a server instance to be installed; whether that is SQL Compact, Express, Standard, or Enterprise.

If you are using SQL Express in your c# application and you want to deploy the database to an instance that is on the same machine then you should look here: http://social.technet.microsoft.com/wiki/contents/articles/940.how-to-embed-sql-server-express-in-an-application.aspx

If you are deploying the database to an existing instance on a server somewhere then you should consider connecting to the database and running the DDL scripts to create the database and each of the objects or running a RESTORE DATABASE command.

You may also consider one of the many NUGET packages that allow you to generate scripts that deploy database objects.


I hope you found this helpful! If you did, please vote it as helpful on the left. If it answered your question, please mark it as the answer below. :)