Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCommand.ExecuteReaderAsync Method

.NET Framework 4.6 and 4.5

Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this SqlCommand.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method ExecuteReaderAsync() An asynchronous version of ExecuteReader, which sends the CommandText to the Connection and builds a SqlDataReader. Exceptions will be reported via the returned Task object.
Public method ExecuteReaderAsync(CancellationToken) An asynchronous version of ExecuteReader, which sends the CommandText to the Connection and builds a SqlDataReader.The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
Public method ExecuteReaderAsync(CommandBehavior) An asynchronous version of ExecuteReader, which sends the CommandText to the Connection, and builds a SqlDataReader. Exceptions will be reported via the returned Task object.
Public method ExecuteReaderAsync(CommandBehavior, CancellationToken) An asynchronous version of ExecuteReader, which sends the CommandText to the Connection, and builds a SqlDataReaderThe cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
Top

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

Show:
© 2015 Microsoft