what will be the connection string for sql server connection in C# windows app.
By 1anurag1
@1anurag1 (3576)
India
March 19, 2010 2:26pm CST
i have developed a windows based application on dot net.but i want that my database sql server must be installed on other machine and the application on different machine.
i think if i just change the connection string in app.config file in each client than it must work.what would be the string. how to access database from other system application. please help me
1 response
@darkdeivu (257)
• Philippines
12 Apr 10
Here are sample code of the connection string for SQL server connection in C# windows app.
SQL SqlConnection .NET strings
Standard Security:
1. "Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"
2."Server=Your_Server_Name;Database=Your_Database_Name;UserID=Your_Username;Password=Your_Password;Trusted_Connection=False"
Trusted connection
1."Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"
2."Server=Your_Server_Name;Database=Your_Database_Name;Trusted_Connection=True;"
I hope this code will help you.. Happy coding!!


