• notice
  • Congratulations on the launch of the Sought Tech site

Some problems in deep SQL data connection

I still don’t know the difference between the various keywords in the connectionstring very much.It’s cumbersome to death.
Now let’s briefly describe some relevant insights......
****************** *********************************
What is the difference between initial catalog and database
Initial Catalog  ;DataBase:
There is actually no difference between the two but the name is different, as if the real name of a human being is the same as the previous name..Can call you.
Integrated Security=SSPI This means to log in to the SQL SERVER server as the current WINDOWS system user.If the SQL SERVER server does not support this method of logging in, an error will occur.
You can log in with the user name and password of SQL SERVER, such as:
"Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=database name; Data Source=;User ID=sa;Password=Password"
*************************** ************************
Integrated   Security    -   or  -    Trusted_Connection  'false'   When it is    false  , the user   ID   and password will be specified in the connection.When it is    true  , the current   Windows   account credentials will be used for authentication.   Recognizable values ​​are   true, false, yes, no   and the equivalent of   true     sspi (strongly recommended).  
******************************************* ******
ADO.net   Database connection methods in
Some commonly used Connection string (C# code):
The code is as follows: div>

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=Northwind;");
SqlConnection   conn  =   new   SqlConnection("   data   source=(loc al);initial   catalog=xr;integrated   security=SSPI;
persist   security   info=False;workstation   id=XURUI;packet   size=4096;    ");
SqlConnection   myConn    =   new   System.Data.SqlClient.SqlConnection("Persist   Security   Info=False;Integrated
SqlConnection   conn  =   new   SqlConnection(   "   ; uid=sa;pwd=passwords;initial   catalog=pubs;data   source=;Connect   Timeout=900");


Technical otaku

Sought technology together

Related Topic


Leave a Reply