question:
I am working on, Visual Studio 2010 Premium, I know that there is no possibility to add Local Database. For this reason, database is added through Server Explorer > Add Connections.
And my DB file is saved in: C:\\Program Files\\Micrisoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\ContactDB.mdf
How it will compile when it is necessary to make installer of application. If VS compile all in 1 package - source codes and DB files? What best practices for this when making Installer of App - if database is added through Server Explorer > Add Connnections.
With regards!
Well as far as I know mdf file is added to your project. If it is not added check the mdf file property Copy to output Directory
. This needs to be set Copy Always
to ensure your mdf file is being copied to output folder.
Here is an another approach to deploying an application with database.
Deploy your Application and Database
Also you can use scripts to create your database from scratch while deploying your application. Check this msdn article
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.