Język

SqlBatch.ExecuteReaderAsync Metoda

Definicja

Przeciążenia

Nazwisko Opis
ExecuteReaderAsync(CancellationToken)

Asynchroniczna wersja ExecuteReader()elementu , która wysyła Commands element do Connection elementu i tworzy element SqlDataReader. Wyjątki będą zgłaszane za pośrednictwem zwróconego obiektu Zadania.

ExecuteReaderAsync(CommandBehavior, CancellationToken)

Asynchroniczna wersja ExecuteReader()elementu , która wysyła Commands element do Connection elementu i tworzy element SqlDataReader. Wyjątki będą zgłaszane za pośrednictwem zwróconego obiektu Zadania.

ExecuteReaderAsync(CancellationToken)

Źródło:
SqlBatch.cs

Asynchroniczna wersja ExecuteReader()elementu , która wysyła Commands element do Connection elementu i tworzy element SqlDataReader. Wyjątki będą zgłaszane za pośrednictwem zwróconego obiektu Zadania.

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)

Parametry

cancellationToken
CancellationToken

Token umożliwiający anulowanie operacji asynchronicznej.

Zwraca

Zadanie reprezentujące operację asynchroniczną.

Wyjątki

Wystąpił błąd podczas wykonywania partii.

Wartość jest nieprawidłowa CommandBehavior .

Token anulowania został anulowany. Ten wyjątek jest przechowywany w zwracanym zadaniu.

Dotyczy

ExecuteReaderAsync(CommandBehavior, CancellationToken)

Asynchroniczna wersja ExecuteReader()elementu , która wysyła Commands element do Connection elementu i tworzy element SqlDataReader. Wyjątki będą zgłaszane za pośrednictwem zwróconego obiektu Zadania.

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)

Parametry

behavior
CommandBehavior

Wystąpienie klasy CommandBehavior, określając opcje wykonywania wsadowego i pobierania danych. Tylko SequentialAccess i CloseConnection są obsługiwane na poziomie partii.

cancellationToken
CancellationToken

Token umożliwiający anulowanie operacji asynchronicznej.

Zwraca

Zadanie reprezentujące operację asynchroniczną.

Wyjątki

Wystąpił błąd podczas wykonywania partii.

Wartość jest nieprawidłowa CommandBehavior .

Token anulowania został anulowany. Ten wyjątek jest przechowywany w zwracanym zadaniu.

Dotyczy