has not been very understanding of the different keywords in connectionstring, the burden of death
Now some of the relevant understanding of the small described ...
***************************************************
What is the difference between initial catalog and database?
Initial Catalog;D atabase:There is no difference between the two, just the name is not the same, as if the real name of the human and has used the same name. Can call you.
********************************************
Integrated SECURITY=SSPI This representation is logged on to the SQL Server server with the current Windows system user, and an error occurs if the SQL Server server does not support this way of logging in.
You can log in using SQL Server's username and password, such as:
"Provider=SQLOLEDB.1; Persist Security info=false;initial catalog= database name; Data source=192.168.0.1; User Id=sa; password= Password "
***************************************************
Integrated security-or-trusted_connection ' false ' when false, the user ID and password are specified in the connection. When True, authentication is performed using the current Windows account credentials. The recognized value is true, false, yes, no, and SSPI (strongly recommended) equivalent to True.
*************************************************
How to connect database in Ado.net
System.Data.SqlClient.SqlConnection
Some common connection strings (C # code):
Copy Code code as follows:
SqlConnection conn = new SqlConnection ("server= (local); integrated security=sspi;database=pubs");
SqlConnection conn = new SqlConnection ("server= (local) \netsdk;database=pubs;integrated Security=sspi");
SqlConnection conn = new SqlConnection ("Data source=localhost;integrated security=sspi;initial Catalog=north Wind; ");
SqlConnection conn = new SqlConnection ("Data source= (local); initial catalog=xr;integrated;
Persist Security Info=false;workstation Id=xurui;packet size=4096; “);
SqlConnection myconn = new System.Data.SqlClient.SqlConnection ("Persist Security info=false;integrated
Security=sspi;database=northwind;server=mysqlserver ");
SqlConnection conn = new SqlConnection ("Uid=sa;pwd=passwords;initial catalog=pubs;data source=127.0.0.1; Connect timeout=900 ");