Analysis of some problems in deep SQL data connection _mysql

Source: Internet
Author: User
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 ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.