DbCommand.ExecuteReaderAsync DbCommand.ExecuteReaderAsync DbCommand.ExecuteReaderAsync DbCommand.ExecuteReaderAsync Method

Definition

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

Overloads

ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync()

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) with CancellationToken.None.

ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior)

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken)

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. This method propagates a notification that operations should be canceled.

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken)

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

Remarks

Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.

ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync() ExecuteReaderAsync()

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) with CancellationToken.None.

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync();
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync ();
member this.ExecuteReaderAsync : unit -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
Public Function ExecuteReaderAsync () As Task(Of DbDataReader)
Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command text.

Remarks

Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.

ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior) ExecuteReaderAsync(CommandBehavior)

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader.

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync(System::Data::CommandBehavior behavior);
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync (System.Data.CommandBehavior behavior);
member this.ExecuteReaderAsync : System.Data.CommandBehavior -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
Public Function ExecuteReaderAsync (behavior As CommandBehavior) As Task(Of DbDataReader)
Parameters
Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command text.

Remarks

Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.

ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken) ExecuteReaderAsync(CancellationToken)

An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. This method propagates a notification that operations should be canceled.

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync (System.Threading.CancellationToken cancellationToken);
member this.ExecuteReaderAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
Parameters
cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command text.

Remarks

Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.

ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken) ExecuteReaderAsync(CommandBehavior, CancellationToken)

Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).

public:
 System::Threading::Tasks::Task<System::Data::Common::DbDataReader ^> ^ ExecuteReaderAsync(System::Data::CommandBehavior behavior, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteReaderAsync (System.Data.CommandBehavior behavior, System.Threading.CancellationToken cancellationToken);
member this.ExecuteReaderAsync : System.Data.CommandBehavior * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
Parameters
cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command text.

Remarks

Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.

Applies to