Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Error Occurs while connecting to the sql server.
I have windows application with sql server as my Database. I want deploy this at client side.
i want make the connection string that will connect my database to my application after installation of my sotware.
I have two connection string one which will connect my DBConnect
C#
public DBConnect()
       {
           //connectionString = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
           connectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=" + Application.StartupPath + "\\SiteManagement.mdf;Integrated Security=True;UserInstance=True";
       }

while second will connect my Sql connection string.
sqlConnection1.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=" + Application.StartupPath + "\\SiteManagement.mdf;Integrated Security=True;User Instance=True";
Posted

1 solution

this site will be useful
http://connectionstrings.com/
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900