System.Data
[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]
1.0.3300.0
1.0.5000.0
2.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.Data.Common.DbConnection
System.ICloneable
System.ComponentModel.DefaultEvent("InfoMessage")
A object represents a unique session to a ssNoVersion data source. With a client/server database system, it is equivalent to a network connection to the server. is used together with and to increase performance when connecting to a Microsoft ssNoVersion database. For all third-party ssNoVersion products, and other OLE DB-supported data sources, use .
When you create an instance of , all properties are set to their initial values. For a list of these values, see the constructor.
See for a list of the keywords in a connection string.
If the goes out of scope, it won't be closed. Therefore, you must explicitly close the connection by calling Close or Dispose. Close and Dispose are functionally equivalent. If the connection pooling value Pooling is set to true or yes, the underlying connection is returned back to the connection pool. On the other hand, if Pooling is set to false or no, the underlying connection to the server is actually closed.
Login and logout events will not be raised on the server when a connection is fetched from or returned to the connection pool, because the connection is not actually closed when it is returned to the connection pool. For more information, see SQL Server Connection Pooling (ADO.NET).
To ensure that connections are always closed, open the connection inside of a using block, as shown in the following code fragment. Doing so ensures that the connection is automatically closed when the code exits the block.
Using connection As New SqlConnection(connectionString)
connection.Open()
' Do work here; connection closed on following line.
End Using
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
// Do work here; connection closed on following line.
}
To deploy high-performance applications, you must use connection pooling. When you use the dnprdnshort Data Provider for ssNoVersion, you do not have to enable connection pooling because the provider manages this automatically, although you can modify some settings. For more information, see SQL Server Connection Pooling (ADO.NET).
If a is generated by the method executing a , the remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the . However, the user can reopen the connection and continue.
An application that creates an instance of the object can require all direct and indirect callers to have sufficient permission to the code by setting declarative or imperative security demands. makes security demands using the object. Users can verify that their code has sufficient permissions by using the object. Users and administrators can also use the Code Access Security Policy Tool (Caspol.exe) to modify security policy at the machine, user, and enterprise levels. For more information, see Security in the .NET Framework. For an example demonstrating how to use security demands, see Code Access Security and ADO.NET.
For more information about handling warning and informational messages from the server, see Working with Connection Events. ssNoVersion engine errors and error messages are documented in ssNoVersion Books Online.
You can force TCP instead of shared memory. You can do that by prefixing tcp: to the server name in the connection string or you can use localhost.
Represents an open connection to a ssNoVersion database. This class cannot be inherited.
Constructor
When a new instance of is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the property.
-
Properties
Initial value
-
empty string ("")
-
15
-
empty string ("")
-
empty string ("")
You can change the value for these properties only by using the property. The class provides functionality for creating and managing the contents of connection strings.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Constructor
When a new instance of is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the property.
-
Properties
Initial value
-
-
15
-
empty string ("")
-
empty string ("")
You can change the value for these properties only by using the property. The class provides functionality for creating and managing the contents of connection strings.
Initializes a new instance of the class when given a string that contains the connection string.
The connection used to open the ssNoVersion database.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Data.Common.DbTransaction
To be added.
To be added.
To be added.
To be added.
Method
System.Data.SqlClient.SqlTransaction
This command maps to the ssNoVersion implementation of BEGIN TRANSACTION.
You must explicitly commit or roll back the transaction using the or method. To make sure that the dnprdnshort Data Provider for ssNoVersion transaction management model performs correctly, avoid using other transaction management models, such as the one provided by ssNoVersion.
If you do not specify an isolation level, the default isolation level is used. To specify an isolation level with the method, use the overload that takes the parameter (). The isolation level set for a transaction persists after the transaction is completed and until the connection is closed or disposed. Setting the isolation level to Snapshot in a database where the snapshot isolation level is not enabled does not throw an exception. The transaction will complete using the default isolation level.
If a transaction is started and a level 16 or higher error occurs on the server, the transaction will not be rolled back until the method is invoked. No exception is thrown on ExecuteReader.
When your query returns a large amount of data and calls BeginTransaction, a is thrown because ssNoVersion does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
For more information on ssNoVersion transactions, see "Explicit Transactions" and "Coding Efficient Transactions" in ssNoVersion Books Online.
Starts a database transaction.
An object representing the new transaction.
1.0.5000.0
2.0.0.0
Method
System.Data.SqlClient.SqlTransaction
This command maps to the ssNoVersion implementation of BEGIN TRANSACTION.
You must explicitly commit or roll back the transaction using the or method. To make sure that the dnprdnshort Data Provider for ssNoVersion transaction management model performs correctly, avoid using other transaction management models, such as the one provided by ssNoVersion.
After a transaction is committed or rolled back, the isolation level of the transaction persists for all subsequent commands that are in autocommit mode (the ssNoVersion default). This can produce unexpected results, such as an isolation level of REPEATABLE READ persisting and locking other users out of a row. To reset the isolation level to the default (READ COMMITTED), execute the tsql SET TRANSACTION ISOLATION LEVEL READ COMMITTED statement, or call followed immediately by . For more information on ssNoVersion isolation levels, see "Isolation Levels in the Database Engine" in ssNoVersion Books Online.
For more information on ssNoVersion transactions, see "Explicit Transactions" and "Coding Efficient Transactions" in ssNoVersion Books Online.
When your query returns a large amount of data and calls BeginTransaction, a is thrown because ssNoVersion does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
Starts a database transaction with the specified isolation level.
An object representing the new transaction.
The isolation level under which the transaction should run.
1.0.5000.0
2.0.0.0
Method
System.Data.SqlClient.SqlTransaction
This command maps to the ssNoVersion implementation of BEGIN TRANSACTION.
The length of the parameter must not exceed 32 characters; otherwise an exception will be thrown.
The value in the parameter can be used in later calls to and in the parameter of the method.
You must explicitly commit or roll back the transaction using the or method. To make sure that the dnprdnshort Data Provider for ssNoVersion transaction management model performs correctly, avoid using other transaction management models, such as the one provided by ssNoVersion.
For more information on ssNoVersion transactions, see "Explicit Transactions" and "Coding Efficient Transactions" in ssNoVersion Books Online.
When your query returns a large amount of data and calls BeginTransaction, a is thrown because ssNoVersion does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
Starts a database transaction with the specified transaction name.
An object representing the new transaction.
The name of the transaction.
1.0.5000.0
2.0.0.0
Method
System.Data.SqlClient.SqlTransaction
This command maps to the ssNoVersion implementation of BEGIN TRANSACTION.
The value in the parameter can be used in later calls to and in the parameter of the method.
You must explicitly commit or roll back the transaction using the or method. To make sure that the ssNoVersion transaction management model performs correctly, avoid using other transaction management models, such as the one provided by ssNoVersion.
After a transaction is committed or rolled back, the isolation level of the transaction persists for all subsequent commands that are in autocommit mode (the ssNoVersion default). This can produce unexpected results, such as an isolation level of REPEATABLE READ persisting and locking other users out of a row. To reset the isolation level to the default (READ COMMITTED), execute the tsql SET TRANSACTION ISOLATION LEVEL READ COMMITTED statement, or call followed immediately by . For more information on ssNoVersion isolation levels, see "Isolation Levels in the Database Engine" in ssNoVersion Books Online.
For more information on ssNoVersion transactions, see "Explicit Transactions" and "Coding Efficient Transactions" in ssNoVersion Books Online.
When your query returns a large amount of data and calls BeginTransaction, a is thrown because ssNoVersion does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
Starts a database transaction with the specified isolation level and transaction name.
An object representing the new transaction.
The isolation level under which the transaction should run.
The name of the transaction.
1.0.5000.0
2.0.0.0
Method
System.Void
The value supplied in the parameter must be a valid database name. The parameter cannot contain a null value, an empty string, or a string with only blank characters.
Changes the current database for an open .
The name of the database to use instead of the current database.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Void
When you are using ssNoVersion on Windows Server, developers can take advantage of functionality that lets the client application supply both the current and a new password in order to change the existing password. Applications can implement functionality such as prompting the user for a new password during initial login if the old one has expired, and this operation can be completed without administrator intervention.
The method changes the ssNoVersion password for the user indicated in the supplied parameter to the value supplied in the parameter. If the connection string includes the option for integrated security (that is, "Integrated Security=True" or the equivalent), an exception is thrown.
To determine that the password has expired, calling the method raises a . In order to indicate that the password that is contained within the connection string must be reset, the property for the exception contains the status value 18487 or 18488. The first value (18487) indicates that the password has expired and the second (18488) indicates that the password must be reset before logging in.
This method opens its own connection to the server, requests the password change, and closes the connection as soon as it has completed. This connection is not retrieved from, nor returned to, the ssNoVersion connection pool.
Changes the ssNoVersion password for the user indicated in the connection string to the supplied new password.
The connection string that contains enough information to connect to the server that you want. The connection string must contain the user ID and the current password.
The new password to set. This password must comply with any password security policy set on the server, including minimum length, requirements for specific characters, and so on.
Method
2.0.0.0
System.Void
resets (or empties) the connection pool. If there are connections in use at the time of the call, they are marked appropriately and will be discarded (instead of being returned to the pool) when is called on them.
Empties the connection pool.
Method
2.0.0.0
System.Void
clears the connection pool that is associated with the . If additional connections associated with are in use at the time of the call, they are marked appropriately and are discarded (instead of being returned to the pool) when is called on them.
Empties the connection pool associated with the specified connection.
The to be cleared from the pool.
Method
System.Void
The method rolls back any pending transactions. It then releases the connection to the connection pool, or closes the connection if connection pooling is disabled.
Pending transactions started using tsql or are automatically rolled back when the connection is reset if connection pooling is enabled. If connection pooling is off, the transaction is rolled back after SqlConnection.Close is called. Transactions started through are controlled through the System.Transactions infrastructure, and are not affected by SqlConnection.Close.
An application can call more than one time. No exception is generated.
If the goes out of scope, it won't be closed. Therefore, you must explicitly close the connection by calling Close or Dispose. Close and Dispose are functionally equivalent. If the connection pooling value Pooling is set to true or yes, the underlying connection is returned back to the connection pool. On the other hand, if Pooling is set to false or no, the underlying connection to the server is closed.
Login and logout events will not be raised on the server when a connection is fetched from or returned to the connection pool, because the connection is not actually closed when it is returned to the connection pool. For more information, see SQL Server Connection Pooling (ADO.NET).
Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Garbage Collection.
Closes the connection to the database. This is the preferred method of closing any open connection.
1.0.5000.0
2.0.0.0
Property
System.String
The current connection string.
The is similar to an OLE DB connection string, but is not identical. Unlike OLE DB or ADO, the connection string that is returned is the same as the user-set , minus security information if the Persist Security Info value is set to false (default). The dnprdnshort Data Provider for ssNoVersion does not persist or return the password in a connection string unless you set Persist Security Info to true.
You can use the property to connect to a database. The following example illustrates a typical connection string.
"Persist Security Info=False;Integrated Security=true;Initial Catalog=Northwind;server=(local)"
Use the new to construct valid connection strings at run time. For more information, see Building Connection Strings.
The property can be set only when the connection is closed. Many of the connection string values have corresponding read-only properties. When the connection string is set, these properties are updated, except when an error is detected. In this case, none of the properties are updated. properties return only those settings that are contained in the .
To connect to a local computer, specify "(local)" for the server. If a server name is not specified, a connection will be attempted to the default instance on the local computer.
Resetting the on a closed connection resets all connection string values (and related properties) including the password. For example, if you set a connection string that includes "Database= AdventureWorks", and then reset the connection string to "Data Source=myserver;Integrated Security=true", the property is no longer set to "AdventureWorks".
The connection string is parsed immediately after being set. If errors in syntax are found when parsing, a runtime exception, such as , is generated. Other errors can be found only when an attempt is made to open the connection.
The basic format of a connection string includes a series of keyword/value pairs separated by semicolons. The equal sign (=) connects each keyword and its value. To include values that contain a semicolon, single-quote character, or double-quote character, the value must be enclosed in double quotation marks. If the value contains both a semicolon and a double-quote character, the value can be enclosed in single quotation marks. The single quotation mark is also useful if the value starts with a double-quote character. Conversely, the double quotation mark can be used if the value starts with a single quotation mark. If the value contains both single-quote and double-quote characters, the quotation mark character used to enclose the value must be doubled every time it occurs within the value.
To include preceding or trailing spaces in the string value, the value must be enclosed in either single quotation marks or double quotation marks. Any leading or trailing spaces around integer, Boolean, or enumerated values are ignored, even if enclosed in quotation marks. However, spaces within a string literal keyword or value are preserved. Single or double quotation marks may be used within a connection string without using delimiters (for example, Data Source= my'Server or Data Source= my"Server), unless a quotation mark character is the first or last character in the value.
Keywords are not case sensitive.
The following table lists the valid names for keyword values within the .
-
Keyword
Default
Description
-
Addr
N/A
Synonym of Data Source.
-
Address
N/A
Synonym of Data Source.
-
App
N/A
Synonym of Application Name.
-
Application Name
N/A
The name of the application, or '.NET SQLClient Data Provider' if no application name is provided.
An application name can be 128 characters or less.
-
ApplicationIntent
ReadWrite
Declares the application workload type when connecting to a server. Possible values are ReadOnly and ReadWrite. For example:
ApplicationIntent=ReadOnly
For more information about SqlClient support for Always On Availability Groups, see SqlClient Support for High Availability, Disaster Recovery.
-
Asynchronous Processing
-or-
Async
'false'
When true, enables asynchronous operation support. Recognized values are true, false, yes, and no.
This property is ignored beginning in net_v45. For more information about SqlClient support for asynchronous programming, see Asynchronous Programming.
-
AttachDBFilename
-or-
Extended Properties
-or-
Initial File Name
N/A
The name of the primary database file, including the full path name of an attachable database. AttachDBFilename is only supported for primary data files with an .mdf extension.
If the value of the AttachDBFileName key is specified in the connection string, the database is attached and becomes the default database for the connection.
If this key is not specified and if the database was previously attached, the database will not be reattached. The previously attached database will be used as the default database for the connection.
If this key is specified together with the AttachDBFileName key, the value of this key will be used as the alias. However, if the name is already used in another attached database, the connection will fail.
The path may be absolute or relative by using the DataDirectory substitution string. If DataDirectory is used, the database file must exist within a subdirectory of the directory pointed to by the substitution string.
Remote server, HTTP, and UNC path names are not supported.
The database name must be specified with the keyword 'database' (or one of its aliases) as in the following:
"AttachDbFileName=|DataDirectory|\data\YourDB.mdf;integrated security=true;database=YourDatabase"
An error will be generated if a log file exists in the same directory as the data file and the 'database' keyword is used when attaching the primary data file. In this case, remove the log file. Once the database is attached, a new log file will be automatically generated based on the physical path.
-
Connect Timeout
-or-
Connection Timeout
-or-
Timeout
15
The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.
Valid values are greater than or equal to 0 and less than or equal to 2147483647.
When opening a connection to a Azure SQL Database, set the connection timeout to 30 seconds.
-
Connection Lifetime
-or-
Load Balance Timeout
0
When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. This is useful in clustered configurations to force load balancing between a running server and a server just brought online.
A value of zero (0) causes pooled connections to have the maximum connection timeout.
-
Context Connection
'false'
true if an in-process connection to ssNoVersion should be made.
-
Current Language
-or-
Language
N/A
Sets the language used for database server warning or error messages.
The language name can be 128 characters or less.
-
Data Source
-or-
Server
-or-
Address
-or-
Addr
-or-
Network Address
N/A
The name or network address of the instance of ssNoVersion to which to connect. The port number can be specified after the server name:
server=tcp:servername, portnumber
When specifying a local instance, always use (local). To force a protocol, add one of the following prefixes:
np:(local), tcp:(local), lpc:(local)
Beginning in net_v45, you can also connect to a LocalDB database as follows:
server=(localdb)\\myInstance
For more information about LocalDB, see SqlClient Support for LocalDB.
Data Source must use the TCP format or the Named Pipes format.
TCP format is as follows:
-
tcp:<host name>\<instance name>
-
tcp:<host name>,<TCP/IP port number>
The TCP format must start with the prefix "tcp:" and is followed by the database instance, as specified by a host name and an instance name.
The host name MUST be specified in one of the following ways:
-
NetBIOSName
-
IPv4Address
-
IPv6Address
The instance name is used to resolve to a particular TCP/IP port number on which a database instance is hosted. Alternatively, specifying a TCP/IP port number directly is also allowed. If both instance name and port number are not present, the default database instance is used.
The Named Pipes format is as follows:
-
np:\\<host name>\pipe\<pipe name>
The Named Pipes format MUST start with the prefix "np:" and is followed by a named pipe name.
The host name MUST be specified in one of the following ways:
-
NetBIOSName
-
IPv4Address
-
IPv6Address
The pipe name is used to identify the database instance to which the .NET Framework application will be connected.
If the value of the Network key is specified, the prefixes "tcp:" and "np:" should not be specified.
You can force the use of TCP instead of shared memory, either by prefixing tcp: to the server name in the connection string, or by using localhost.
-
Encrypt
'false'
When true, ssNoVersion uses SSL encryption for all data sent between the client and server if the server has a certificate installed. Recognized values are true, false, yes, and no. For more information, see Connection String Syntax (ADO.NET).
Beginning in net_v45, when TrustServerCertificate is false and Encrypt is true, the server name (or IP address) in a ssNoVersion SSL certificate must exactly match the server name (or IP address) specified in the connection string. Otherwise, the connection attempt will fail. For information about support for certificates whose subject starts with a wildcard character (*), see Accepted wildcards used by server certificates for server authentication.
-
Enlist
'true'
true indicates that the ssNoVersion connection pooler automatically enlists the connection in the creation thread's current transaction context.
-
Failover Partner
N/A
The name of the failover partner server where database mirroring is configured.
If the value of this key is "", then Initial Catalog must be present, and its value must not be "".
The server name can be 128 characters or less.
If you specify a failover partner but the failover partner server is not configured for database mirroring and the primary server (specified with the Server keyword) is not available, then the connection will fail.
If you specify a failover partner and the primary server is not configured for database mirroring, the connection to the primary server (specified with the Server keyword) will succeed if the primary server is available.
-
Initial Catalog
-or-
Database
N/A
The name of the database.
The database name can be 128 characters or less.
-
Integrated Security
-or-
Trusted_Connection
'false'
When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication.
Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true.
If User ID and Password are specified and Integrated Security is set to true, the User ID and Password will be ignored and Integrated Security will be used.
is a more secure way to specify credentials for a connection that uses ssNoVersion Authentication (Integrated Security=false).
-
Max Pool Size
100
The maximum number of connections that are allowed in the pool.
Valid values are greater than or equal to 1. Values that are less than Min Pool Size generate an error.
-
Min Pool Size
0
The minimum number of connections that are allowed in the pool.
Valid values are greater than or equal to 0. Zero (0) in this field means no minimum connections are initially opened.
Values that are greater than Max Pool Size generate an error.
-
MultipleActiveResultSets
'false'
When true, an application can maintain multiple active result sets (MARS). When false, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.
Recognized values are true and false.
For more information, see Multiple Active Result Sets (MARS).
-
MultiSubnetFailover
FALSE
Always specify multiSubnetFailover=True when connecting to the availability group listener of a SQL Server 2012 (or later) availability group or a SQL Server 2012 (or later) Failover Cluster Instance. multiSubnetFailover=True configures SqlClient to provide faster detection of and connection to the (currently) active server. Possible values are Yes and No, True and False or 1 and 0. For example:
MultiSubnetFailover=True
The default is False. For more information about SqlClient's support for Always On AGs, see SqlClient Support for High Availability, Disaster Recovery.
-
Network Library
-or-
Network
-or-
Net
N/A
The network library used to establish a connection to an instance of ssNoVersion. Supported values include:
dbnmpntw (Named Pipes)
dbmsrpcn (Multiprotocol, Windows RPC)
dbmsadsn (Apple Talk)
dbmsgnet (VIA)
dbmslpcn (Shared Memory)
dbmsspxn (IPX/SPX)
dbmssocn (TCP/IP)
Dbmsvinn (Banyan Vines)
The corresponding network DLL must be installed on the system to which you connect. If you do not specify a network and you use a local server (for example, "." or "(local)"), shared memory is used. In this example, the network library is Win32 Winsock TCP/IP (dbmssocn), and 1433 is the port being used.
Network Library=dbmssocn;Data Source=000.000.000.000,1433;
-
Packet Size
8000
Size in bytes of the network packets used to communicate with an instance of ssNoVersion.
The packet size can be greater than or equal to 512 and less than or equal to 32768.
-
Password
-or-
PWD
N/A
The password for the ssNoVersion account logging on. Not recommended. To maintain a high level of security, we strongly recommend that you use the Integrated Security or Trusted_Connection keyword instead. is a more secure way to specify credentials for a connection that uses ssNoVersion Authentication.
The password must be 128 characters or less.
-
Persist Security Info
-or-
PersistSecurityInfo
'false'
When set to false or no (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password. Recognized values are true, false, yes, and no.
-
Pooling
'true'
When the value of this key is set to true, any newly created connection will be added to the pool when closed by the application. In a next attempt to open the same connection, that connection will be drawn from the pool.
Connections are considered the same if they have the same connection string. Different connections have different connection strings.
The value of this key can be "true", "false", "yes", or "no".
-
Replication
'false'
true if replication is supported using the connection.
-
Transaction Binding
Implicit Unbind
Controls connection association with an enlisted System.Transactions transaction.
Possible values are:
Transaction Binding=Implicit Unbind;
Transaction Binding=Explicit Unbind;
Implicit Unbind causes the connection to detach from the transaction when it ends. After detaching, additional requests on the connection are performed in autocommit mode. The System.Transactions.Transaction.Current property is not checked when executing requests while the transaction is active. After the transaction has ended, additional requests are performed in autocommit mode.
If the system ends the transaction (in the scope of a using block) before the last command completes, it will throw .
Explicit Unbind causes the connection to remain attached to the transaction until the connection is closed or an explicit SqlConnection.TransactionEnlist(null) is called. Beginning in net_v40_long, changes to Implicit Unbind make Explicit Unbind obsolete. An InvalidOperationException is thrown if Transaction.Current is not the enlisted transaction or if the enlisted transaction is not active.
-
TrustServerCertificate
'false'
When set to true, SSL is used to encrypt the channel when bypassing walking the certificate chain to validate trust. If TrustServerCertificate is set to true and Encrypt is set to false, the channel is not encrypted. Recognized values are true, false, yes, and no. For more information, see Connection String Syntax (ADO.NET).
-
Type System Version
N/A
A string value that indicates the type system the application expects. The functionality available to a client application is dependent on the version of ssNoVersion and the compatibility level of the database. Explicitly setting the type system version that the client application was written for avoids potential problems that could cause an application to break if a different version of ssNoVersion is used.
The type system version cannot be set for common language runtime (CLR) code executing in-process in SQL Server. For more information, see SQL Server Common Language Runtime Integration (ADO.NET).
Possible values are:
Type System Version=SQL Server 2012;
Type System Version=SQL Server 2008;
Type System Version=SQL Server 2005;
Type System Version=Latest;
Type System Version=SQL Server 2012; specifies that the application will require version 11.0.0.0 of Microsoft.SqlServer.Types.dll. The other Type System Version settings will require version 10.0.0.0 of Microsoft.SqlServer.Types.dll.
Latest is obsolete and should not be used. Latest is equivalent to Type System Version=SQL Server 2008;.
-
User ID
-or-
UID
-or-
N/A
The ssNoVersion login account. Not recommended. To maintain a high level of security, we strongly recommend that you use the Integrated Security or Trusted_Connection keywords instead. is a more secure way to specify credentials for a connection that uses ssNoVersion Authentication.
The user ID must be 128 characters or less.
-
User Instance
'false'
A value that indicates whether to redirect the connection from the default ssNoVersion Express instance to a runtime-initiated instance running under the account of the caller.
-
Workstation ID
-or-
WSID
The local computer name
The name of the workstation connecting to ssNoVersion.
The ID must be 128 characters or less.
The following list contains the valid names for connection pooling values within the . For more information, see Connection Pooling for the .NET Framework Data Provider for SQL Server.
-
Connection Lifetime (or Load Balance Timeout)
-
Enlist
-
Max Pool Size
-
Min Pool Size
-
Pooling
When you are setting keyword or connection pooling values that require a Boolean value, you can use 'yes' instead of 'true', and 'no' instead of 'false'. Integer values are represented as strings.
The dnprdnshort Data Provider for ssNoVersion uses its own protocol to communicate with ssNoVersion. Therefore, it does not support the use of an ODBC data source name (DSN) when connecting to ssNoVersion because it does not add an ODBC layer.
Universal data link (UDL) files are not supported for the dnprdnshort Data Provider for ssNoVersion.
In this release, the application should use caution when constructing a connection string based on user input (for example when retrieving user ID and password information from a dialog box, and appending it to the connection string). The application should make sure that a user cannot embed additional connection string parameters in these values (for example, entering a password as "validpassword;database=somedb" in an attempt to attach to a different database). If you need to construct connection strings based on user input, use the new , which validates the connection string and helps to eliminate this problem. See Building Connection Strings for more information.
Gets or sets the string used to open a ssNoVersion database.
1.0.5000.0
2.0.0.0
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.ComponentModel.RecommendedAsConfigurable(true)
System.ComponentModel.Editor("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
System.ComponentModel.DefaultValue("")
Property
System.Int32
The amount of time (in seconds) the SqlConnection will wait when attempting to connect.
You can set the amount of time a connection waits to time out by using the Connect Timeout or Connection Timeout keywords in the connection string. A value of 0 indicates no limit, and should be avoided in a because an attempt to connect waits indefinitely.
Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
Method
System.Data.SqlClient.SqlCommand
Creates a new instance of the class with the connection referencing the current instance.
The returned instance can be used to execute T-SQL statements or stored procedures against the current database connection.
Creates and returns a object associated with the .
A object.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Data.Common.DbCommand
To be added.
To be added.
To be added.
Property
System.String
Gets a value representing the current SQL Server database.
The property updates dynamically. If you change the current database using a tsql statement or the method, an informational message is sent and the property is updated automatically.
Gets the name of the current database or the database to be used after a connection is opened.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
Property
System.String
Gets a value representing the current SQL Server instance.
The property returns null if the connection string for the is "context connection=true".
Gets the name of the instance of ssNoVersion to which to connect.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(true)
Method
System.Void
To be added: an object of type 'bool'
Disposes the current instance.
Disposes the current instance.
Disposing this class will close the current connection, if one is active.
1.0.5000.0
2.0.0.0
Method
1.0.5000.0
2.0.0.0
System.Void
You can use the method to enlist in a distributed transaction. Because it enlists a connection in a instance, EnlistTransaction takes advantage of functionality available in the namespace for managing distributed transactions, making it preferable to EnlistDistributedTransaction for this purpose. For more information, see Performing a Distributed Transaction.
You can continue to enlist in an existing distributed transaction using the EnlistDistributedTransaction method if auto-enlistment is disabled. Enlisting in an existing distributed transaction makes sure that, if the transaction is committed or rolled back, modifications made by the code at the data source are also committed or rolled back.
EnlistDistributedTransaction returns an exception if the has already started a transaction using . However, if the transaction is a local transaction started at the data source (for example, by explicitly executing the BEGIN TRANSACTION statement using an object), EnlistDistributedTransaction rolls back the local transaction and enlists in the existing distributed transaction as requested. You do not receive notice that the local transaction was rolled back, and are responsible for managing any local transactions not started using .
Enlists in the specified transaction as a distributed transaction.
A reference to an existing in which to enlist.
Property
2.0.0.0
System.Boolean
To be added.
When you set to true, errors that were previously treated as exceptions are now handled as events. All events fire immediately and are handled by the event handler. If is is set to false, then events are handled at the end of the procedure.
An error with a severity level of 17 or above that causes the server to stop processing the command needs to be handled as an exception. In this case, an exception is thrown regardless of how the error is handled in the event.
For more information on working with events, see Connection Events. For more information on errors generated by the ssNoVersion engine, see ssNoVersion Books Online.
Gets or sets the property.
Method
2.0.0.0
System.Data.DataTable
To be added.
Returns schema information for the data source of this . For more information about scheme, see SQL Server Schema Collections.
A that contains schema information.
Method
2.0.0.0
System.Data.DataTable
To be added.
Returns schema information for the data source of this using the specified string for the schema name.
A that contains schema information.
Specifies the name of the schema to return.
Method
2.0.0.0
System.Data.DataTable
The parameter can supply n depth of values, which are specified by the restrictions collection for a specific collection. In order to set values on a given restriction, and not set the values of other restrictions, you need to set the preceding restrictions to null and then put the appropriate value in for the restriction that you would like to specify a value for.
An example of this is the "Tables" collection. If the "Tables" collection has three restrictions--database, owner, and table name--and you want to get back only the tables associated with the owner "Carl", you need to pass in the following values: null, "Carl". If a restriction value is not passed in, the default values are used for that restriction. This is the same mapping as passing in null, which is different from passing in an empty string for the parameter value. In that case, the empty string ("") is considered to be the value for the specified parameter.
Returns schema information for the data source of this using the specified string for the schema name and the specified string array for the restriction values.
A that contains schema information.
Specifies the name of the schema to return.
A set of restriction values for the requested schema.
Event
System.Data.SqlClient.SqlInfoMessageEventHandler
Clients that want to process warnings or informational messages sent by the server should create an delegate to listen to this event.
The event occurs when a message with a severity of 10 or less is returned by ssNoVersion. Messages that have a severity between 11 and 20 raise an error and messages that have a severity over 20 causes the connection to close. For more information on ssNoVersion error levels, see "Database Engine Error Severities" in ssNoVersion Books Online.
For more information and an example, see Working with Connection Events.
Occurs when ssNoVersion returns a warning or informational message.
1.0.5000.0
2.0.0.0
Method
System.Void
The draws an open connection from the connection pool if one is available. Otherwise, it establishes a new connection to an instance of ssNoVersion.
If the goes out of scope, it is not closed. Therefore, you must explicitly close the connection by calling .
If you specify a port number other than 1433 when you are trying to connect to an instance of ssNoVersion and using a protocol other than TCP/IP, the method fails. To specify a port number other than 1433, include "server=machinename,port number" in the connection string, and use the TCP/IP protocol.
The dnprdnshort Data Provider for ssNoVersion requires the Security permission with "Allows calls to unmanaged assemblies" enabled ( with set to UnmanagedCode) to open a with SQL Debugging enabled.
Opens a database connection with the property settings specified by the .
1.0.5000.0
2.0.0.0
Property
System.Int32
The packet size, in bytes.
If an application performs bulk copy operations, or sends or receives lots of text or image data, a packet size larger than the default may improve efficiency because it causes fewer network read and write operations. If an application sends and receives small amounts of information, you can set the packet size to 512 bytes (using the Packet Size value in the ), which is sufficient for most data transfer operations. For most applications, the default packet size is best.
may be a value in the range of 512 and 32767 bytes. An exception is generated if the value is outside this range.
Setting the default value to a number greater than 8000 will cause the packets to use the MultiPage allocator on the instance of ssNoVersion instead of the much more efficient SinglePage allocator, reducing the overall scalability of the ssNoVersion. For more information on how ssNoVersion uses memory, see Memory Architecture in ssNoVersion Books Online.
Gets the size (in bytes) of network packets used to communicate with an instance of ssNoVersion.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
Property
System.String
A value representing the version of the currently connected SQL Server instance.
The version is of the form ##.##.####, where the first two digits are the major version, the next two digits are the minor version, and the last four digits are the release version. The string is of the form major.minor.build, where major and minor are exactly two digits and build is exactly four digits.
was called while the returned Task was not completed and the connection was not opened after a call to .
Gets a string that contains the version of the instance of ssNoVersion to which the client is connected.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
Property
System.Data.ConnectionState
The current connection state, represented by an instance of the enum.
Returns an enumeration indicating the state of the . Closing and reopening the connection will refresh the value of .
Indicates the state of the during the most recent network operation performed on the connection.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
Event
System.Data.StateChangeEventHandler
This event is triggered when the connection status changes to open or closed.
Occurs when the state of the event changes.
1.0.5000.0
System.Data.DataSysDescription(Description="Event triggered when the connection changes state.")
Property
2.0.0.0
System.ComponentModel.DefaultValue(false)
System.Boolean
To be added.
Enabling statistics gathering has a minor, but measurable effect on performance and therefore should be enabled only when it is required.
When set to true, enables statistics gathering for the current connection.
Method
1.0.5000.0
System.Data.IDbTransaction
Once the transaction has completed, you must explicitly commit or roll back the transaction by using the or method.
Begins a database transaction.
An object that represents the new transaction.
Method
1.0.5000.0
System.Data.IDbTransaction
Once the transaction has completed, you must explicitly commit or roll back the transaction by using the or method.
Begins a database transaction with the specified value.
An object that represents the new transaction.
One of the values.
Method
1.0.5000.0
System.Data.IDbCommand
To be added.
Creates and returns a Command object that is associated with the connection.
A Command object that is associated with the connection.
Method
1.0.5000.0
2.0.0.0
System.Object
This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
This member is only supported by the .NET Compact Framework.
Creates a new object that is a copy of the current instance.
A new object that is a copy of this instance.
Property
System.String
A value representing the connection's network client.
The string typically contains the network name of the client. The property corresponds to the Workstation ID connection string property.
Gets a string that identifies the database client.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)