Key words |
Default value |
Description |
Application Name |
N/A |
The name of the application, or ". Net SqlClient Data Provider" (if no application name is provided). |
Async |
' False ' |
If set to true, asynchronous operation support is enabled. The recognizable values are true, false, yes, and No. |
AttachDbFileName Or Extended Properties Or Initial File Name |
N/A |
The name of the primary database file, including the full pathname of the database that can be connected. Only master data files with the. mdf extension support AttachDbFileName. If the primary data file is read-only, the attach operation will fail. The path can be either an absolute or a relative path, depending on whether or not you use DataDirectory to replace the string. If you use DataDirectory, the corresponding database file must exist in the subdirectory of the directory that the replacement string points to.
Attention: |
Remote servers, HTTP, and UNC path names are not supported. |
You must specify the database name by using the keyword "database" (or one of its aliases) as follows: "Attachdbfilename=| datadirectory|/data/yourdb.mdf;integrated Security=true;database=yourdatabase " If there is a log file in the directory where the data file resides and the "database" keyword is used when attaching the master data file, an error is generated. In this case, remove the log file. After the database is attached, a new log file is automatically generated based on the physical path. |
Connect Timeout Or Connection Timeout |
15 |
The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. |
Context Connection |
' False ' |
True if an in-process connection should be made to SQL Server. |
Current Language |
N/A |
SQL Server language record name. |
Data Source Or Server Or Address Or Addr Or Network address |
N/A |
The name or network address of the instance of SQL Server to which you want to connect. You can specify the port number after the server name: Server=tcp:servername, PortNumber Always use (local) when specifying a native instance. To enforce the use of a protocol, add one of the following prefixes: NP: (local), TCP: (local), LPC: (local)
Attention: |
Ado.net 2.0 does not support the execution of asynchronous commands on SQL Server 2000 or later shared memory. However, you can force TCP to replace shared memory by adding a "TCP:" prefix to the server name in the connection string, or by using localhost. |
|
Encrypt |
' False ' |
When this value is true, if the server side has a certificate installed, SQL Server uses SSL encryption for all data that is transferred between the client and the server. The recognizable values are true, false, yes, and No. |
Enlist |
' False ' |
True indicates that the SQL Server connection pooling program automatically enlists the connection in the current transaction context of the creation thread. |
Failover Partner |
N/A |
The name of the failover partner server in which to configure database mirroring. The. NET Framework version 1.0 or 1.1 does not support the Failover Partner keyword. |
Initial Catalog Or Database |
N/A |
The name of the database. |
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. |
Multipleactiveresultsets |
' False ' |
If true, the application can maintain multiple active result sets (MARS). If False, the application must process or cancel multiple result sets in one batch before executing any other batches on the connection. The recognizable value is true and false. The. NET Framework version 1.0 or 1.1 does not support this keyword. |
Network Library Or Net |
' DBMSSOCN ' |
A network library that is used to establish a connection to an instance of SQL Server. Supported values include DBNMPNTW (Named Pipes), DBMSRPCN (Multiprotocol), 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 which you want to connect. If you do not specify a network, use a local server (such as "." or "(local)"), the shared memory is used. |
Packet Size |
8192 |
The size, in bytes, of the network packet used to communicate with an instance of SQL Server. |
Password Or Pwd |
N/A |
The password for the SQL Server account login. Recommended not to use. To maintain a high level of security, we strongly recommend that you use the integrated or trusted_connection keyword. |
Persist Security Info |
' False ' |
When the value is set to False or no (strongly recommended), security-sensitive information, such as a password, will not be returned as part of the connection if the connection is open or is always open. Resetting the connection string resets all connection string values, including passwords. The recognizable values are true, false, yes, and No. |
Replication |
' False ' |
True if a connection is used to support replication. |
Transaction Binding |
Implicit Unbind |
Controls the connection associated with a registered System.Transactions transaction. Possible values include the following: Transaction binding=implicit Unbind; Transaction binding=explicit Unbind; Implicit Unbind enables the connection to detach from the transaction at the end of the transaction. After separation, other requests on the connection are executed in autocommit mode. The System.Transactions.Transaction.Current property is not checked when the request is executed while the transaction is active. When the transaction ends, other requests are executed in autocommit mode. Explicit Unbind allows the connection to remain connected to the transaction until the connection is closed or an explicit sqlconnection.transactionenlist (null) is invoked. If Transaction.Current is not a registered transaction or a registered transaction is not active, a InvalidOperationException is thrown. |
TrustServerCertificate |
' false ' |
If set to true, use SSL to encrypt the channel, but not through the certificate chain pair to Reliability is validated. If you set TrustServerCertificate to True and set Encrypt to False, the channel is not encrypted. The recognizable values are true, false, yes, and No. For more information, see "Encryption Hierarchy" (encryption hierarchy) and "Using encryption without in SQL Server book online (SQL Server 2005 Books Online) Validation "(using unauthenticated encryption). |
Type System Version |
N/A |
A string value indicating the type system expected by the application. Possible values include the following: Type System version=sql Server 2000; Type System version=sql Server 2005; Type System version=sql Server 2008; Type System version=latest; If set to SQL Server 2000, the SQL Server 2000 type system will be used. When connecting to an instance of SQL Server 2005, perform the following transformations: XML to NTEXT UDT to VARBINARY VARCHAR (max), NVARCHAR (max), and VARBINARY (max) are respectively to TEXT, NEXT, and IMAGE. If set to SQL Server 2005, the SQL Server 2005 type system will be used. No conversions are made to the current version of Ado.net. If set to Latest, this client-server pair will be used for the latest version that cannot be processed. This latest version will be updated automatically as the client and server components are upgraded. |
User ID |
N/A |
SQL Server login account. Recommended not to use. To maintain a high level of security, we strongly recommend that you use the integrated or trusted_connection keyword. |
User Instance |
' False ' |
A value that indicates whether to redirect the connection from the default SQL Server Express instance to a runtime-initiated instance running under the caller account. |
The name of the workstation to which
Workstation ID |
Local computer name |
Connect to SQL Server. |