i have a winform application with SQL localDB and i used advanced installer to deploy it, but once deployed in my target machine inside C:Programme files , i get an error when i tried to update my database that say : Database read-only and that is because the folder deployed in does not give permission to the user to write in it.
So, i installed my application in \user\appdata\roaming where i have permission to write and it worked !
that's not good, i want to keep my application folder in C:Progamme files and copy only mydatabase.mdr in \user\appdata\roaming.
but if i do that, i can no longer access my database with my current connectionstring, so my question is how can i change my connectionstring to access my database inside \user\appdata\roaming in any target machine?
this is my connectionstring :
<connectionStrings>
<add name="GTC_Frater_Razes.Properties.Settings.db_alarmeConnectionString"
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\db_alarme.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>