DbCommand.ExecuteReaderAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results.
Overloads
ExecuteReaderAsync() |
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results. Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) with CancellationToken.None. |
ExecuteReaderAsync(CommandBehavior) |
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results. Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken). |
ExecuteReaderAsync(CancellationToken) |
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results. Invokes ExecuteDbDataReaderAsync(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()
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results.
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.
An invalid CommandBehavior value.
Remarks
Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.
See also
Applies to
ExecuteReaderAsync(CommandBehavior)
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results.
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
- behavior
- CommandBehavior
One of the enumeration values that specifies how the command should execute and how data should be retrieved.
Returns
A task representing the asynchronous operation.
Exceptions
An error occurred while executing the command.
An invalid CommandBehavior value.
Remarks
Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.
See also
Applies to
ExecuteReaderAsync(CancellationToken)
An asynchronous version of ExecuteReader, which executes the command against its connection, returning a DbDataReader which can be used to access the results.
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>
Public Function ExecuteReaderAsync (cancellationToken As CancellationToken) As Task(Of DbDataReader)
Parameters
- cancellationToken
- CancellationToken
A token to cancel the asynchronous operation.
Returns
A task representing the asynchronous operation.
Exceptions
An error occurred while executing the command.
An invalid CommandBehavior value.
Remarks
Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.
See also
Applies to
ExecuteReaderAsync(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>
Public Function ExecuteReaderAsync (behavior As CommandBehavior, cancellationToken As CancellationToken) As Task(Of DbDataReader)
Parameters
- behavior
- CommandBehavior
One of the enumeration values that specifies the command behavior.
- cancellationToken
- CancellationToken
A token to cancel the asynchronous operation.
Returns
A task representing the asynchronous operation.
Exceptions
An error occurred while executing the command.
An invalid CommandBehavior value.
Remarks
Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.