I made an application, and there is a problem with deploying a Form with SQL. Actually, somehow I made to deploy, but there is an error with app launching. I installed app on other PC and this is what the part of problem said:
"a database with the same name exists or specified file cannot be opened or it's located on unc share"
.mdf
file exists, but dunno whats wrong..
This is my connection string:
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=Data Source=.;Integrated Security=True;AttachDbFilename=|DataDirectory|\Data.mdf");
and this is app.config
:
<connectionStrings>
<add name="Gym_Software.Properties.Settings.DataConnectionString"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Data.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Database properties: http://prntscr.com/6ptywq