GetFieldValueAsync(int, CancellationToken)

Declaration

// C#
public override Task<T> GetFieldValueAsync<T>(int ordinal, CancellationToken cancellationToken);

Type Parameters

T - The type of the value to be returned.

Parameters

ordinal - The zero-based column index.

cancellationToken - The input cancellation token which can be used by the application to cancel the task.

Return Value

Task<T> object representing the asynchronous operation immediately without blocking the calling thread for the whole duration of the query execution.

Implements

DbDataReader

Exceptions

InvalidOperationException - The connection is closed, the reader is closed, Read() has not been called, all rows have been read.

IndexOutOfRangeException - The column index is invalid.

InvalidCastException – The value returned by the database cannot be cast to T.