SqlConnection. ConnectionString related keywords

Source: Internet
Author: User
Tags connection reset

Since I was born from poverty, I have not yet been familiar with Orcle, DB2 and other big brother, I used to use ACCESS to play in school, and then I was SQL. The ACCESS connection string does not change, so there may be other providers. For SQL, I often use Visual Studio to connect to the database, and then copy the connection string in the server properties, he has never really taken his string seriously. Now, as I want to contact EnterpriseLibrary, I have collected it from the Internet and summarized it. By the way, I can consolidate it. I will not blur it any more...

ConnectionString mainly needs to recognize several of his keywords. Here, we will also introduce his personal words. His words will not be described here:

Application Name: Application Name. If no Application Name is provided, the default value is ". Net SqlClient Data Provider ".

AttachDBFilename/extended properties/Initial File Name: Name of the master File that can be connected to the database, including the complete path Name. You must use the keyword "database" to specify the Name of the database.

Connect Timeout/Connection Timeout: the length of time (in seconds) waiting for Connection to the server before terminating the attempt and generating an error. The default value is 15.

Current Language: SQL Server Language.

Data Source/Server/Address/Addr/Network Address: Name or Network Address of the SQL Server instance to be connected.

Encrypt: When this value is true, if a certificate is installed on the Server, SQL Server uses SSL encryption for all data transmitted between the client and the Server. The identifiable values are true, false, yes, and no. The default value is false.

Initial Catalog/Database: name of the Database.

Integrated Security/Trusted_Connection: When the value is false, the user ID and password are specified in the connection. If this parameter is set to true, the current Windows Account creden。 are used for authentication. The identifiable values are true, false, yes, no, and SSPI equivalent to true (strongly recommended ).

Network Library/Net: The Network Library used to establish a connection with the SQL Server instance. Supported values include dbnmpntw (Named Pipe), dbmsrpcn (multi-protocol), dbmsadsn (Apple Talk), dbmsgnet (VIA), dbmslpcn (shared memory), and dbmsspxn (IPX/SPX) and dbmssocn (TCP/IP ). The corresponding network DLL must be installed on the system to be connected. If a local server (such as "." or "(local)") is used without specifying the network, the shared memory is used.

Packet Size: the Size of the network Packet used to communicate with the SQL Server instance, in bytes. The default value is 8192.

Password/Pwd: Password used to log on to the SQL Server account (do not use this Password. To maintain the highest level of Security, we strongly recommend that you use the Integrated Security or Trusted_Connection keyword ).

Persist Security Info: When this value is set to false or no (strongly recommended), if the connection is enabled or is always in the open state, then the Security sensitive information (such as the password) will not be returned as part of the connection. Resetting the connection string resets all connection string values, including passwords. The identifiable values are true, false, yes, and no. The default value is false.

User ID: SQL Server Logon account (not recommended. To maintain the highest level of Security, we strongly recommend that you use the Integrated Security or Trusted_Connection keyword ).

Workstation ID: the name of the Workstation connected to SQL Server. The default value is the name of the local computer.

Valid name of the Connection Pool value in ConnectionString:

Connection Lifetime: when the Connection is returned to the pool, the creation time is compared with the current time. If the time length (in seconds) exceeds the value specified by Connection Lifetime, the connection will be destroyed. This is useful in clustering configuration (used to force load balancing between running servers and servers that are just online ). The zero (0) value indicates the maximum connection timeout for the pool connection. The default value is 0.

Connection Reset: determines whether to Reset the database Connection when the database Connection is extracted from the pool. For Microsoft SQL Server 7.0, setting it to false can avoid an additional round-trip to the Server when the connection is obtained. Note that the connection status (such as the database context) is not reset at this time ), the default value is true.

Enlist: When this value is true, the pool program automatically registers connections in the context of the current transaction of the Creation thread. The identifiable values are true, false, yes, and no. The default value is true.

Max Pool Size: the maximum number of connections allowed in the Pool.

Min Pool Size: the minimum number of connections allowed in the Pool.

Pooling: When this value is true, the system extracts the SQLConnection object from the corresponding pool, or creates the object and adds it to the corresponding pool if necessary. The identifiable values are true, false, yes, and no. The default value is true.

The above information is collected on MSDN. You can see all or more content on MSDN. Here, we only use it to make it easier for you to read and consolidate your knowledge, at the same time, we also hope that developers who want to use this product every day but do not really know all the applications can read it more intuitively.

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.