Click here to Skip to main content
15,850,360 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,
I have created a winform application using c# ( visual studio 2010 ) and a database using sql server 2008. and i have made a setup project but the question is :
1- how to put the database files in my setup project?
2- how can i attach the database automatically in sql server 2008 express when i install the application on another machine?

Look at the answers given for the similar question asked here[^].
Various article links are present in it that will help you achieve the same.

Have a look at these too:
Creating setup With support for database creation Using VS.NET[^]
Create database during installation of a .NET application [^]
Deploy your Application and Database[^]
Share this answer
I have used User Instance=True and Initial Catalog=MyDBName in my connection string and the problem had been solved.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900