I am using Visual Studio 2010
for my windows application development and I have developed an application. Now I want to publish this application as a windows installer and I have done all the steps as below in the image.
I have both the .mdf
and the .ldf
database files within the DATA
folder. Within the code, i have given the connection string as below,
SqlConnection con = new SqlConnection(@"Server=.\SQLExpress;AttachDbFilename=DATA\\Database.mdf;");
I published the website and installed on my laptop. It gets installed and then runs but I am getting an error in the database as I have checked this with printing exception in the application. The error I obtained was
A network-related or instance-specific error occurred while establishing a connection to SQL Server
And the application takes too much time to load from one form to another. Is my connection string right or should I change it? Is there any way to make the forms load much faster?