Hi,
I create windows application in c#.
How do i add mdf file in setup of the project for the database and connection string for that so that i will run on other pc in which there is no sql server and visual studio ? Like we download any application(inventory management system) and run in our pc.
Thanks,
Girish
Shakti Singh DulawatPosted May 2, 2016, 3:25 AM
1) Add a folder named ”DB” to the project, and copy the database file into it after you detach it from your sql server.
2) Change your connection string like this:
http://www.msdotnet.co.in/2013/07/how-to-create-setup-fileexe-with.html#.VCLWAvmSy64
http://www.youtube.com/watch?v=YqvgerKYtOg
Hope this will help you.
..................................................................................................................................
If this post is useful then mark it as "Accepted Answer"
Shakti Singh DulawatPosted May 6, 2016, 4:46 AM
2)when you creating setup add primary output and "content file" that will automatically add all file and folder from your project it will have database also
These picture will help you to understand more..
Creating an MSI Package for C# Windows Application Using a Visual Studio Setup Project