I've built a Windows Form App project and now I wanna create a setup which is going to be used all computer. I published my project, and after I had clicked my exe, it's not working. I'm taking a error message like below.
error is going on like System.Data.DataException:
System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: Cannot attach the file 'C:\Users...
My way:
1- I am using localDb in app-config file, so I've organized conection string for it.
2- I put myDb.mdf into my project, after I'd set its "restrict address" for single-user and I'd detached.
3.I published my project.
<connectionStrings>
<add name="DatabaseContext" connectionString="Server=DESKTOP-N01M7RV;Database=DB_GOPCBS;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
</connectionStrings>