แก้ไข

แชร์ผ่าน


DbDataSource Class

Definition

Represents a data source which can be used to obtain open connections, and against which commands can be executed directly.

public ref class DbDataSource abstract : IAsyncDisposable, IDisposable
public abstract class DbDataSource : IAsyncDisposable, IDisposable
type DbDataSource = class
    interface IDisposable
    interface IAsyncDisposable
Public MustInherit Class DbDataSource
Implements IAsyncDisposable, IDisposable
Inheritance
DbDataSource
Implements

Remarks

Unlike DbProviderFactory, which is purely a factory for provider-specific objects such as DbConnection, DbDataSource hands out open connections to specific databases, encapsulating all the information needed to connect to a database. Depending on how the DbDataSource was configured, the connections it hands out may be pooled.

Constructors

DbDataSource()

Initializes a new instance of the DbDataSource class.

Properties

ConnectionString

Gets the connection string of the database represented by this DbDataSource. The exact contents of the connection string depend on the specific data source for this connection.

Methods

CreateBatch()

Returns a DbBatch that's ready for execution against the DbDataSource.

CreateCommand(String)

Returns a DbCommand that's ready for execution against the DbDataSource.

CreateConnection()

Returns a new, closed connection to the database represented by this DbDataSource.

CreateDbBatch()

Returns a DbBatch that's ready for execution against the DbDataSource.

CreateDbCommand(String)

Returns a DbCommand that's ready for execution against the DbDataSource.

CreateDbConnection()

Returns a new, closed connection to the database represented by this DbDataSource.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

Dispose(Boolean)

Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the DbDataSource class.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

DisposeAsyncCore()

Performs application-defined tasks associated with freeing, releasing, or resetting managed resources asynchronously.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OpenConnection()

Returns a new, open connection to the database represented by this DbDataSource.

OpenConnectionAsync(CancellationToken)

Asynchronously returns a new, open connection to the database represented by this DbDataSource.

OpenDbConnection()

Returns a new, open connection to the database represented by this DbDataSource.

OpenDbConnectionAsync(CancellationToken)

Asynchronously returns a new, open connection to the database represented by this DbDataSource.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

ConfigureAwait(IAsyncDisposable, Boolean)

Configures how awaits on the tasks returned from an async disposable will be performed.

Applies to