Export (0) Print
Expand All

SqlConnection Methods

The SqlConnection type exposes the following members.

  Name Description
Public method BeginTransaction() Starts a database transaction.
Public method BeginTransaction(IsolationLevel) Starts a database transaction with the specified isolation level.
Public method BeginTransaction(String) Starts a database transaction with the specified transaction name.
Public method BeginTransaction(IsolationLevel, String) Starts a database transaction with the specified isolation level and transaction name.
Public method ChangeDatabase Changes the current database for an open SqlConnection. (Overrides DbConnection.ChangeDatabase(String).)
Public method Static member ChangePassword(String, String) Changes the SQL Server password for the user indicated in the connection string to the supplied new password.
Public method Static member ChangePassword(String, SqlCredential, SecureString) Changes the SQL Server password for the user indicated in the SqlCredential object.
Public method Static member ClearAllPools Empties the connection pool.
Public method Static member ClearPool Empties the connection pool associated with the specified connection.
Public method Close Closes the connection to the database. This is the preferred method of closing any open connection. (Overrides DbConnection.Close().)
Public method CreateCommand Creates and returns a SqlCommand object associated with the SqlConnection.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method Dispose() Releases all resources used by the Component. (Inherited from Component.)
Public method EnlistDistributedTransaction Enlists in the specified transaction as a distributed transaction.
Public method EnlistTransaction Enlists in the specified transaction as a distributed transaction. (Overrides DbConnection.EnlistTransaction(Transaction).)
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method GetSchema() Returns schema information for the data source of this SqlConnection. For more information about scheme, see SQL Server Schema Collections. (Overrides DbConnection.GetSchema().)
Public method GetSchema(String) Returns schema information for the data source of this SqlConnection using the specified string for the schema name. (Overrides DbConnection.GetSchema(String).)
Public method GetSchema(String, String[]) Returns schema information for the data source of this SqlConnection using the specified string for the schema name and the specified string array for the restriction values. (Overrides DbConnection.GetSchema(String, String[]).)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method Open Opens a database connection with the property settings specified by the ConnectionString. (Overrides DbConnection.Open().)
Public method OpenAsync() An asynchronous version of Open, which opens a database connection with the settings specified by the ConnectionString. This method invokes the virtual method OpenAsync with CancellationToken.None. (Inherited from DbConnection.)
Public method OpenAsync(CancellationToken) An asynchronous version of Open, which opens a database connection with the property settings specified by the ConnectionString. The cancellation token can be used to request that the operation be abandoned before the connection timeout elapses. Exceptions will be propagated via the returned Task. If the connection timeout time elapses without successfully connecting, the returned Task will be marked as faulted with an Exception. The implementation returns a Task without blocking the calling thread for both pooled and non-pooled connections. (Overrides DbConnection.OpenAsync(CancellationToken).)
Public method ResetStatistics If statistics gathering is enabled, all values are reset to zero.
Public method RetrieveStatistics Returns a name value pair collection of statistics at the point in time the method is called.
Public method ToString Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)
Top

  Name Description
Explicit interface implemetation Private method ICloneable.Clone Creates a new object that is a copy of the current instance.
Explicit interface implemetation Private method IDbConnection.BeginTransaction() Begins a database transaction. (Inherited from DbConnection.)
Explicit interface implemetation Private method IDbConnection.BeginTransaction(IsolationLevel) Begins a database transaction with the specified IsolationLevel value. (Inherited from DbConnection.)
Explicit interface implemetation Private method IDbConnection.CreateCommand Creates and returns a DbCommand object that is associated with the current connection. (Inherited from DbConnection.)
Top
Show:
© 2014 Microsoft