I have a simple windows forms app (C#) in development, and I am just trying to test to see that I can publish it for others to use, It has a local Database, and it is utilizing Microsoft SQL Server Database File (SqlClient). I tried publishing what I have (so far) to myfriend pc. when he opened the app this error came out to me and he couldn't access to app local database
and this the app.config
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="sell.Properties.Settings.DatabaseConnectionString"
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
and i uset in my forms like that
using (SqlCommand cmd = new SqlCommand("insert into ProductTbl (Id,Nom,Quantité,Prix,Catégorie,Photo) values (@prodid , @prodnam, @prodqyan ,@prodprix,@prodcat,@pictur)", con))
