C # Connection SQL connection string
SQL Server Authentication Connection string
private string connstrsqlserver = "server= server name; uid= login name; pwd= login password; database= database tutorial name";
Windows Authentication Connection string
private string connstrwindows = "server= server name; database= database name; Trusted_connection=sspi ";
Accessing SQL Server 2008 databases in SqlClient in C # code
. NET Framework Data Provider for SQL Server standard notation
Data source=myserveraddress;initial catalog=mydatabase; User Id=myusername; Password=mypassword;
. NET Framework Data Provider for SQL Server another standard notation
Server=myserveraddress;database=mydatabase; User Id=myusername; Password=mypassword; Trusted_connection=false;
. NET Framework Data Provider for SQL Server Trust connection notation
Data source=myserveraddress;initial catalog=mydatabase;integrated Security=sspi;
. NET Framework Data Provider for SQL Server Trust connection another way of writing
Server=myserveraddress;database=mydatabase; Trusted_connection=true;