Defines the core behavior of database connections and provides a base class for database-specific connections.
public ref class DbConnection abstract : System::ComponentModel::Component, IDisposable, System::Data::IDbConnection
public abstract class DbConnection : System.ComponentModel.Component, IDisposable, System.Data.IDbConnection
type DbConnection = class inherit Component interface IDbConnection interface IDisposable
Public MustInherit Class DbConnection Inherits Component Implements IDbConnection, IDisposable
Notes to Inheritors
When you inherit from DbConnection, you must override the following members: Close(), BeginDbTransaction(IsolationLevel), ChangeDatabase(String), CreateDbCommand(), Open(), and StateChange. You must also provide the following properties: ConnectionString, Database, DataSource, ServerVersion, and State.
|DbConnection() DbConnection() DbConnection() DbConnection()||
Initializes a new instance of the DbConnection class.
|CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents||
Gets a value indicating whether the component can raise an event.(Inherited from Component)
|ConnectionString ConnectionString ConnectionString ConnectionString||
When overridden in a derived class, gets or sets the string used to open the connection.
|ConnectionTimeout ConnectionTimeout ConnectionTimeout ConnectionTimeout||
Gets the time to wait while establishing a connection before terminating the attempt and generating an error.
|Container Container Container Container||Component)|
|Database Database Database Database||
When overridden in a derived class, 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.
|DataSource DataSource DataSource DataSource||
When overridden in a derived class, gets the name of the database server to which to connect.
|DbProviderFactory DbProviderFactory DbProviderFactory DbProviderFactory|
|DesignMode DesignMode DesignMode DesignMode||
Gets a value that indicates whether the Component is currently in design mode.(Inherited from Component)
|Events Events Events Events||
Gets the list of event handlers that are attached to this Component.(Inherited from Component)
|ServerVersion ServerVersion ServerVersion ServerVersion||
When overridden in a derived class, gets a string that represents the version of the server to which the object is connected.
|Site Site Site Site||Component)|
|State State State State||
Gets a string that describes the state of the connection.
|Disposed Disposed Disposed Disposed||
Occurs when the component is disposed by a call to the Dispose() method.(Inherited from Component)
|StateChange StateChange StateChange StateChange||
Occurs when the state of the event changes.
Explicit Interface Implementations
|IDbConnection.BeginTransaction() IDbConnection.BeginTransaction() IDbConnection.BeginTransaction() IDbConnection.BeginTransaction()||
Begins a database transaction.
|IDbConnection.BeginTransaction(IsolationLevel) IDbConnection.BeginTransaction(IsolationLevel) IDbConnection.BeginTransaction(IsolationLevel) IDbConnection.BeginTransaction(IsolationLevel)||
Begins a database transaction with the specified isolation level.
|IDbConnection.CreateCommand() IDbConnection.CreateCommand() IDbConnection.CreateCommand() IDbConnection.CreateCommand()||
Creates and returns a DbCommand object that is associated with the current connection.