DbDataReader.ReadAsync DbDataReader.ReadAsync DbDataReader.ReadAsync DbDataReader.ReadAsync Method

Definition

Implements the asynchronous version of Read(), but returns a Task synchronously, blocking the calling thread.

Overloads

ReadAsync() ReadAsync() ReadAsync() ReadAsync()

An asynchronous version of Read(), which advances the reader to the next record in a result set. This method invokes ReadAsync(CancellationToken) with CancellationToken.None.

ReadAsync(CancellationToken) ReadAsync(CancellationToken) ReadAsync(CancellationToken)

This is the asynchronous version of Read(). Providers should override with an appropriate implementation. The cancellationToken may optionally be ignored.

The default implementation invokes the synchronous Read() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Read will be communicated via the returned Task Exception property.

Do not invoke other methods and properties of the DbDataReader object until the returned Task is complete.

Remarks

For more information about asynchronous programming, see Asynchronous Programming.

ReadAsync() ReadAsync() ReadAsync() ReadAsync()

An asynchronous version of Read(), which advances the reader to the next record in a result set. This method invokes ReadAsync(CancellationToken) with CancellationToken.None.

public:
 System::Threading::Tasks::Task<bool> ^ ReadAsync();
public System.Threading.Tasks.Task<bool> ReadAsync ();
member this.ReadAsync : unit -> System.Threading.Tasks.Task<bool>
Public Function ReadAsync () As Task(Of Boolean)

Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command text.

Remarks

For more information about asynchronous programming, see Asynchronous Programming.

See also

ReadAsync(CancellationToken) ReadAsync(CancellationToken) ReadAsync(CancellationToken)

This is the asynchronous version of Read(). Providers should override with an appropriate implementation. The cancellationToken may optionally be ignored.

The default implementation invokes the synchronous Read() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Read will be communicated via the returned Task Exception property.

Do not invoke other methods and properties of the DbDataReader object until the returned Task is complete.

public:
 virtual System::Threading::Tasks::Task<bool> ^ ReadAsync(System::Threading::CancellationToken cancellationToken);
public virtual System.Threading.Tasks.Task<bool> ReadAsync (System.Threading.CancellationToken cancellationToken);
abstract member ReadAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.ReadAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>

Parameters

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

The cancellation instruction.

Returns

A task representing the asynchronous operation.

Exceptions

An error occurred while executing the command text.

Remarks

For more information about asynchronous programming, see Asynchronous Programming.

See also

Applies to