System.Data.Common.DbConnection Members

The members of System.Data.Common.DbConnection are listed below.

See Also: Inherited members from System.ComponentModel.Component

Protected Constructors

Initializes a new instance of the System.Data.Common.DbConnection class.

Public Properties

abstract
ConnectionStringstring.

Gets or sets the string used to open the connection.

[read-only]
ConnectionTimeoutint.

Gets the time to wait while establishing a connection before terminating the attempt and generating an error.

[read-only]
abstract
Databasestring.

Gets the name of the current database after a connection is opened, or the database name specified in the connection string before the connection is opened.

[read-only]
abstract
DataSourcestring.

Gets the name of the database server to which to connect.

[read-only]
abstract
ServerVersionstring.

Gets a string that represents the version of the server to which the object is connected.

[read-only]
abstract
StateSystem.Data.ConnectionState.

Gets a string that describes the state of the connection.

Public Methods

BeginTransaction() : DbTransaction

Starts a database transaction.

BeginTransaction(System.Data.IsolationLevel) : DbTransaction

Starts a database transaction with the specified isolation level.

abstract
ChangeDatabase(string)

Changes the current database for an open connection.

abstract
Close()

Closes the connection to the database. This is the preferred method of closing any open connection.

CreateCommand() : DbCommand

Creates and returns a System.Data.Common.DbCommand object associated with the current connection.

EnlistTransaction(System.Transactions.Transaction)

Enlists in the specified transaction.

GetSchema() : System.Data.DataTable

Returns schema information for the data source of this System.Data.Common.DbConnection.

GetSchema(string) : System.Data.DataTable

Returns schema information for the data source of this System.Data.Common.DbConnection using the specified string for the schema name.

GetSchema(string, string[]) : System.Data.DataTable

Returns schema information for the data source of this System.Data.Common.DbConnection using the specified string for the schema name and the specified string array for the restriction values.

abstract
Open()

Opens a database connection with the settings specified by the DbConnection.ConnectionString.

Protected Methods

abstract
BeginDbTransaction(System.Data.IsolationLevel) : DbTransaction

Starts a database transaction.

abstract
CreateDbCommand() : DbCommand

Creates and returns a System.Data.Common.DbCommand object associated with the current connection.

OnStateChange(System.Data.StateChangeEventArgs)

Raises the DbConnection.StateChange event.

Public Events

StateChange

Occurs when the state of the event changes.

Explicitly Implemented Interface Members

System.Data.IDbConnection.BeginTransaction

Begins a database transaction.

System.Data.IDbConnection.BeginTransaction

Begins a database transaction with the specified System.Data.IsolationLevel value.

System.Data.IDbConnection.CreateCommand

Creates and returns a System.Data.Common.DbCommand object that is associated with the current connection.