DbCommand.ExecuteReaderAsync Method (CommandBehavior)

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Invokes ExecuteDbDataReaderAsync.

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)

member ExecuteReaderAsync : 
        behavior:CommandBehavior -> Task<DbDataReader>

Parameters

behavior
Type: System.Data.CommandBehavior

One of the CommandBehavior values.

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
Return to top
Show: