GetFieldValueAsync(int)
Declaration
// C#
public Task<T> GetFieldValueAsync<T>(int ordinal);
Type Parameters
T
- The type of the value to be returned.
Parameters
ordinal
- The zero-based column index.
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
Remarks
This will call into the GetFieldValueAsync
implementation with argument cancellationToken
passed as CancellationToken.None
.
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
.