I'm using Visual Studio 2015 and I just created a Windows Forms application with a SQL Server database. I finished the program and tried to run the application on the other computer but it didn't run. I also tried to install .Net Framework v4.0 and SQL Server Express on that computer and also put the database in path C:\
so that the SqlConnection
path on my computer to another computer will be the same.
The code is like this:
SqlConnection cn;
SqlCommand cm;
SqlDataReader dr;
string connection = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Database1.mdf;Integrated Security=True";
But I got an error that is the database I placed in path C:\
is not writable whatsoever. I want to know what I can do in order to run the application.