DbCommand::ExecuteReaderAsync Method (CommandBehavior, CancellationToken)
.NET Framework (current version)
Invokes ExecuteDbDataReaderAsync.
Assembly: System.Data (in System.Data.dll)
public:
Task<DbDataReader^>^ ExecuteReaderAsync(
CommandBehavior behavior,
CancellationToken cancellationToken
)
Parameters
- behavior
-
Type:
System.Data::CommandBehavior
One of the CommandBehavior values.
- cancellationToken
-
Type:
System.Threading::CancellationToken
The token to monitor for cancellation requests.
Return Value
Type: System.Threading.Tasks::Task<DbDataReader^>^A task representing the asynchronous operation.
| Exception | Condition |
|---|---|
| DbException | An error occurred while executing the command text. |
| ArgumentException | An invalid CommandBehavior value. |
Managed provider implementers must call ExecuteDbDataReaderAsync in ExecuteReaderAsync. For more information about asynchronous programming, see Asynchronous Programming.
Universal Windows Platform
Available since 10
.NET Framework
Available since 4.5
Available since 10
.NET Framework
Available since 4.5
Show: