ConnectionManager Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
connection settings and creation
public abstract class ConnectionManager : Microsoft.SqlServer.Management.Common.ConnectionSettings
type ConnectionManager = class
inherit ConnectionSettings
Public MustInherit Class ConnectionManager
Inherits ConnectionSettings
- Inheritance
- Derived
No |
Infinite wait (Inherited from ConnectionSettings) |
Access |
(Inherited from ConnectionSettings) |
Application |
The application intent of the connection Valid values are ReadWrite and ReadOnly (Inherited from ConnectionSettings) |
Application |
The name of the application. 'SQL Management' if no application name has been provided. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Authentication |
The authentication type of the connection (Inherited from ConnectionSettings) |
Auto |
|
Captured |
|
Connect |
If set to true, the connection will be made with the credentials of the specified user. This will assume impersonation, however the LoginSecure flags and Login and Password fields will not be affected. ConnectionCannotBeChangedException (Inherited from ConnectionSettings) |
Connect |
Specifies the NT user that is used when creating an impersonated connection. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException PropertyNotSetException (Inherited from ConnectionSettings) |
Connect |
Specifies password of the NT user that is used when creating an impersonated connection. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException PropertyNotSetException (Inherited from ConnectionSettings) |
Connection |
Connection protocol. |
Connection |
The property will return either the user specified connection string or it will return the computed connection string based on object settings. If explicitly set, All properties in the ServerConnection object will be populated to reflect the passed in connection string. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Connect |
The length of time (in seconds) to wait for a connection to the server before terminating the attempt and throwing an exception. Default is 30 seconds (same as Shiloh). Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Current |
Returns the current database context. |
Database |
The edition of the Database Engine |
Database |
Returns the database engine type of SQL Server. Exceptions: ConnectionFailureException |
Database |
TBD (Inherited from ConnectionSettings) |
Encrypt |
whether "encrypt=true" is specified in the connection string (Inherited from ConnectionSettings) |
Host |
The host platform of the server (Linux/Windows/etc) |
In |
Returns true if the object has been connected with the server at least once. If true, property changes are not allowed any more and ConnectionCannotBeChangedException will be thrown when a property has been changed. |
Is |
Returns true if the database engine authenticates using contained authentication. Exceptions: ConnectionFailureException |
Is |
Indicates that the connection has been forcefully disconnected |
Is |
Returns true if the SqlConnection object is connected with the server. This can only return true for non pooled connections as pooled connections are always closed directly after an operation. |
Lock |
LockTimeout is the Lock timeout in seconds. Default -1 is for indefinite. InvalidPropertyValueException is thrown for all other negative numbers. Positive LockTimeout will be multiplied by 1000 and then used for "SET LOCK_TIMEOUT" setting. |
Login |
The SQL Server Login name that is used to connect to the server. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException PropertyNotSetException (Inherited from ConnectionSettings) |
Login |
If set to true, Windows integrate security is used and Login and Password are ignored. If not set, Sql Server Authentication is used. Exceptions: ConnectionCannotBeChangedException (Inherited from ConnectionSettings) |
Max |
The maximum number of connections allowed in the pool. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Min |
The minimum number of connections maintained in the pool. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Multiple |
Enable MARS from the connection. Default is false. (Inherited from ConnectionSettings) |
Network |
Identifies the client network protocol that is used to connect to SQL Server. If you do not specify a network and you use a local server, shared memory is used. If you do not specify a network and you use a remote server, the one of the configured client protocols is used. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Non |
By default, all connections to SQL Server are taken from an ADO.NET connection pool.If set to true, this allows users to create a non-pooled connection (will not be reused when closed). Exceptions: ConnectionCannotBeChangedException (Inherited from ConnectionSettings) |
Packet |
Size in bytes of the network packets used to communicate with an instance of SQL Server. Default is 8192. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Password |
The password that is used with Login to connect to the server. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException PropertyNotSetException (Inherited from ConnectionSettings) |
Pooled |
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. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Product |
Gets the ProductVersion server property of this connection |
Reset |
Tells us whether ConnectionString needs to be reset in SqlConnectionObject property of ConnectionManager or not. (Inherited from ConnectionSettings) |
Secure |
The property will return a SecureString version of either the user specified connection string or it will return the computed connection string based on object settings. If explicitly set, All properties in the ServerConnection object will be populated to reflect the passed in connection string. Exceptions: ConnectionCannotBeChangedException (Inherited from ConnectionSettings) |
Secure |
The password that is used with Login to connect to the server. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException PropertyNotSetException (Inherited from ConnectionSettings) |
Server |
The name of the SQL Server the object will connect to. If not set, the local server is implied. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Server |
Returns the major version number of SQL Server. I.e. 8 for SQL Server 2000. Exceptions: ConnectionFailureException |
Sql |
Returns a reference to the SqlConnection object used by the ConnectionContext object. This should always return the valid sqlConnection object with the latest valid ConnectionString set. Exceptions: PropertyNotAvailableException |
Trust |
Indicate whether the client trusts the server certificate (Inherited from ConnectionSettings) |
Workstation |
The name of the workstation connecting to SQL Server. Exceptions: ConnectionCannotBeChangedException InvalidPropertyValueException (Inherited from ConnectionSettings) |
Check |
Check if we are connecting to a supported server version. block off <= 7.0 in ServerConnection. |
Connect() |
Creates the actual connection to SQL Server. Ignored if already connected. It is optional to call this method, as the connection will be opened when required. Exceptions: ConnectionFailureException |
Disconnect() |
Closes the connection with SQL Server. Ignored if already disconnected. Exceptions: ConnectionFailureException |
Execute |
Executes T-SQL using the appropriate methods depending on the action information passed as the parameter. |
Force |
Enforces a disconnect and ensures that connection cannot be re-opened again |
Throw |
(Inherited from ConnectionSettings) |
Throw |
(Inherited from ConnectionSettings) |
To |
(Inherited from ConnectionSettings) |
Info |
Occurs when SQL Server returns a warning or informational message. Uses SqlClient.SqlInfoMessageEventHandler. |
Remote |
Called when the server needs to connect to remote servers and the login fails |
Server |
Occurs when SQL Server returns a warning or informational message. Uses SqlClient.SqlInfoMessageEventHandler. |
State |
Occurs when the state of the connection changes. Uses System.Data.StateChangeEventHandler. |
Statement |