Language

SqlBatch.ExecuteReaderAsync Method

Definition

Overloads

Name Description
ExecuteReaderAsync(CancellationToken)

An asynchronous version of ExecuteReader(), which sends the Commands to the Connection and builds a SqlDataReader. Exceptions will be reported via the returned Task object.

ExecuteReaderAsync(CommandBehavior, CancellationToken)

An asynchronous version of ExecuteReader(), which sends the Commands to the Connection and builds a SqlDataReader. Exceptions will be reported via the returned Task object.

ExecuteReaderAsync(CancellationToken)

Source:
SqlBatch.cs

An asynchronous version of ExecuteReader(), which sends the Commands to the Connection and builds a SqlDataReader. Exceptions will be reported via the returned Task object.

public System.Threading.Tasks.Task<Microsoft.Data.SqlClient.SqlDataReader> ExecuteReaderAsync(System.Threading.CancellationToken cancellationToken = default);
member this.ExecuteReaderAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Data.SqlClient.SqlDataReader>
override this.ExecuteReaderAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Data.SqlClient.SqlDataReader>
Public Function ExecuteReaderAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of SqlDataReader)

Parameters

cancellationToken
CancellationToken

A token to cancel the asynchronous operation.

Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the batch.

The CommandBehavior value is invalid.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

ExecuteReaderAsync(CommandBehavior, CancellationToken)

An asynchronous version of ExecuteReader(), which sends the Commands to the Connection and builds a SqlDataReader. Exceptions will be reported via the returned Task object.

public System.Threading.Tasks.Task<Microsoft.Data.SqlClient.SqlDataReader> ExecuteReaderAsync(System.Data.CommandBehavior behavior, System.Threading.CancellationToken cancellationToken = default);
member this.ExecuteReaderAsync : System.Data.CommandBehavior * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Data.SqlClient.SqlDataReader>
override this.ExecuteReaderAsync : System.Data.CommandBehavior * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Data.SqlClient.SqlDataReader>
Public Function ExecuteReaderAsync (behavior As CommandBehavior, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SqlDataReader)

Parameters

behavior
CommandBehavior

An instance of CommandBehavior, specifying options for batch execution and data retrieval. Only SequentialAccess and CloseConnection are supported at the batch level.

cancellationToken
CancellationToken

A token to cancel the asynchronous operation.

Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the batch.

The CommandBehavior value is invalid.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to