Search Results for

    Show / Hide Table of Contents

    Class NpgsqlDataReader

    Reads a forward-only stream of rows from a data source.

    Inheritance
    Object
    MarshalByRefObject
    DbDataReader
    NpgsqlDataReader
    Implements
    IEnumerable
    IDataReader
    IDataRecord
    IDisposable
    IAsyncDisposable
    IDbColumnSchemaGenerator
    Inherited Members
    DbDataReader.GetFieldValueAsync<T>(Int32)
    DbDataReader.IsDBNullAsync(Int32)
    DbDataReader.NextResultAsync()
    DbDataReader.ReadAsync()
    DbDataReader.IDataRecord.GetData(Int32)
    DbDataReader.VisibleFieldCount
    MarshalByRefObject.GetLifetimeService()
    MarshalByRefObject.InitializeLifetimeService()
    MarshalByRefObject.MemberwiseClone(Boolean)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql
    Assembly: Npgsql.dll
    Syntax
    public sealed class NpgsqlDataReader : DbDataReader, IEnumerable, IDataReader, IDataRecord, IDisposable, IAsyncDisposable, IDbColumnSchemaGenerator

    Properties

    | Improve this Doc View Source

    Depth

    Gets a value indicating the depth of nesting for the current row. Always returns zero.

    Declaration
    public override int Depth { get; }
    Property Value
    Type Description
    Int32
    Overrides
    DbDataReader.Depth
    | Improve this Doc View Source

    FieldCount

    Gets the number of columns in the current row.

    Declaration
    public override int FieldCount { get; }
    Property Value
    Type Description
    Int32
    Overrides
    DbDataReader.FieldCount
    | Improve this Doc View Source

    HasRows

    Gets a value that indicates whether this DbDataReader contains one or more rows.

    Declaration
    public override bool HasRows { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    DbDataReader.HasRows
    | Improve this Doc View Source

    IsClosed

    Gets a value indicating whether the data reader is closed.

    Declaration
    public override bool IsClosed { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    DbDataReader.IsClosed
    | Improve this Doc View Source

    IsOnRow

    Indicates whether the reader is currently positioned on a row, i.e. whether reading a column is possible. This property is different from HasRows in that HasRows will return true even if attempting to read a column will fail, e.g. before Read() has been called

    Declaration
    public bool IsOnRow { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Item[Int32]

    Gets the value of the specified column as an instance of Object.

    Declaration
    public override object this[int ordinal] { get; }
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Property Value
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.Item[Int32]
    | Improve this Doc View Source

    Item[String]

    Gets the value of the specified column as an instance of Object.

    Declaration
    public override object this[string name] { get; }
    Parameters
    Type Name Description
    String name

    The name of the column.

    Property Value
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.Item[String]
    | Improve this Doc View Source

    RecordsAffected

    Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

    Declaration
    public override int RecordsAffected { get; }
    Property Value
    Type Description
    Int32

    The number of rows changed, inserted, or deleted. -1 for SELECT statements; 0 if no rows were affected or the statement failed.

    Overrides
    DbDataReader.RecordsAffected
    | Improve this Doc View Source

    Rows

    Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

    Declaration
    public ulong Rows { get; }
    Property Value
    Type Description
    UInt64

    The number of rows changed, inserted, or deleted. 0 for SELECT statements, if no rows were affected or the statement failed.

    | Improve this Doc View Source

    Statements

    Returns details about each statement that this reader will or has executed.

    Declaration
    [Obsolete("Use the new DbBatch API")]
    public IReadOnlyList<NpgsqlBatchCommand> Statements { get; }
    Property Value
    Type Description
    IReadOnlyList<NpgsqlBatchCommand>
    Remarks

    Note that some fields (i.e. rows and oid) are only populated as the reader traverses the result.

    For commands with multiple queries, this exposes the number of rows affected on a statement-by-statement basis, unlike RecordsAffected which exposes an aggregation across all statements.

    Methods

    | Improve this Doc View Source

    Close()

    Closes the NpgsqlDataReader reader, allowing a new command to be executed.

    Declaration
    public override void Close()
    Overrides
    DbDataReader.Close()
    | Improve this Doc View Source

    CloseAsync()

    Closes the NpgsqlDataReader reader, allowing a new command to be executed.

    Declaration
    public override Task CloseAsync()
    Returns
    Type Description
    Task
    Overrides
    DbDataReader.CloseAsync()
    | Improve this Doc View Source

    Dispose(Boolean)

    Releases the resources used by the NpgsqlDataReader.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing
    Overrides
    DbDataReader.Dispose(Boolean)
    | Improve this Doc View Source

    DisposeAsync()

    Releases the resources used by the NpgsqlDataReader.

    Declaration
    public override ValueTask DisposeAsync()
    Returns
    Type Description
    ValueTask
    Overrides
    DbDataReader.DisposeAsync()
    | Improve this Doc View Source

    GetBoolean(Int32)

    Gets the value of the specified column as a Boolean.

    Declaration
    public override bool GetBoolean(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Boolean

    The value of the specified column.

    Overrides
    DbDataReader.GetBoolean(Int32)
    | Improve this Doc View Source

    GetByte(Int32)

    Gets the value of the specified column as a byte.

    Declaration
    public override byte GetByte(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Byte

    The value of the specified column.

    Overrides
    DbDataReader.GetByte(Int32)
    | Improve this Doc View Source

    GetBytes(Int32, Int64, Byte[], Int32, Int32)

    Reads a stream of bytes from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset.

    Declaration
    public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Int64 dataOffset

    The index within the row from which to begin the read operation.

    Byte[] buffer

    The buffer into which to copy the data.

    Int32 bufferOffset

    The index with the buffer to which the data will be copied.

    Int32 length

    The maximum number of characters to read.

    Returns
    Type Description
    Int64

    The actual number of bytes read.

    Overrides
    DbDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32)
    | Improve this Doc View Source

    GetChar(Int32)

    Gets the value of the specified column as a single character.

    Declaration
    public override char GetChar(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Char

    The value of the specified column.

    Overrides
    DbDataReader.GetChar(Int32)
    | Improve this Doc View Source

    GetChars(Int32, Int64, Char[], Int32, Int32)

    Reads a stream of characters from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset.

    Declaration
    public override long GetChars(int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Int64 dataOffset

    The index within the row from which to begin the read operation.

    Char[] buffer

    The buffer into which to copy the data.

    Int32 bufferOffset

    The index with the buffer to which the data will be copied.

    Int32 length

    The maximum number of characters to read.

    Returns
    Type Description
    Int64

    The actual number of characters read.

    Overrides
    DbDataReader.GetChars(Int32, Int64, Char[], Int32, Int32)
    | Improve this Doc View Source

    GetColumnSchema()

    Returns schema information for the columns in the current resultset.

    Declaration
    public ReadOnlyCollection<NpgsqlDbColumn> GetColumnSchema()
    Returns
    Type Description
    ReadOnlyCollection<NpgsqlDbColumn>
    | Improve this Doc View Source

    GetColumnSchemaAsync(CancellationToken)

    Asynchronously returns schema information for the columns in the current resultset.

    Declaration
    public Task<ReadOnlyCollection<NpgsqlDbColumn>> GetColumnSchemaAsync(CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<ReadOnlyCollection<NpgsqlDbColumn>>
    | Improve this Doc View Source

    GetData(Int32)

    Returns a nested data reader for the requested column. The column type must be a record or a to Npgsql known composite type, or an array thereof. Currently only supported in non-sequential mode.

    Declaration
    public NpgsqlNestedDataReader GetData(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    NpgsqlNestedDataReader

    A data reader.

    | Improve this Doc View Source

    GetDataTypeName(Int32)

    Gets the data type information for the specified field. This is the PostgreSQL type name (e.g. double precision), not the .NET type (see GetFieldType(Int32) for that).

    Declaration
    public override string GetDataTypeName(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column index.

    Returns
    Type Description
    String
    Overrides
    DbDataReader.GetDataTypeName(Int32)
    | Improve this Doc View Source

    GetDataTypeOID(Int32)

    Gets the OID for the PostgreSQL type for the specified field, as it appears in the pg_type table.

    Declaration
    public uint GetDataTypeOID(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column index.

    Returns
    Type Description
    UInt32
    Remarks

    This is a PostgreSQL-internal value that should not be relied upon and should only be used for debugging purposes.

    | Improve this Doc View Source

    GetDateTime(Int32)

    Gets the value of the specified column as a DateTime object.

    Declaration
    public override DateTime GetDateTime(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    DateTime

    The value of the specified column.

    Overrides
    DbDataReader.GetDateTime(Int32)
    | Improve this Doc View Source

    GetDbDataReader(Int32)

    Reads a forward-only stream of rows from a data source.

    Declaration
    protected override DbDataReader GetDbDataReader(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal
    Returns
    Type Description
    DbDataReader
    Overrides
    DbDataReader.GetDbDataReader(Int32)
    | Improve this Doc View Source

    GetDecimal(Int32)

    Gets the value of the specified column as a Decimal object.

    Declaration
    public override decimal GetDecimal(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Decimal

    The value of the specified column.

    Overrides
    DbDataReader.GetDecimal(Int32)
    | Improve this Doc View Source

    GetDouble(Int32)

    Gets the value of the specified column as a double-precision floating point number.

    Declaration
    public override double GetDouble(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Double

    The value of the specified column.

    Overrides
    DbDataReader.GetDouble(Int32)
    | Improve this Doc View Source

    GetEnumerator()

    Returns an IEnumerator that can be used to iterate through the rows in the data reader.

    Declaration
    public override IEnumerator GetEnumerator()
    Returns
    Type Description
    IEnumerator

    An IEnumerator that can be used to iterate through the rows in the data reader.

    Overrides
    DbDataReader.GetEnumerator()
    | Improve this Doc View Source

    GetFieldType(Int32)

    Gets the data type of the specified column.

    Declaration
    public override Type GetFieldType(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Type

    The data type of the specified column.

    Overrides
    DbDataReader.GetFieldType(Int32)
    | Improve this Doc View Source

    GetFieldValue<T>(Int32)

    Synchronously gets the value of the specified column as a type.

    Declaration
    public override T GetFieldValue<T>(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The column to be retrieved.

    Returns
    Type Description
    T

    The column to be retrieved.

    Type Parameters
    Name Description
    T

    Synchronously gets the value of the specified column as a type.

    Overrides
    DbDataReader.GetFieldValue<T>(Int32)
    | Improve this Doc View Source

    GetFieldValueAsync<T>(Int32, CancellationToken)

    Asynchronously gets the value of the specified column as a type.

    Declaration
    public override Task<T> GetFieldValueAsync<T>(int ordinal, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Int32 ordinal

    The type of the value to be returned.

    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T

    The type of the value to be returned.

    Overrides
    DbDataReader.GetFieldValueAsync<T>(Int32, CancellationToken)
    | Improve this Doc View Source

    GetFloat(Int32)

    Gets the value of the specified column as a single-precision floating point number.

    Declaration
    public override float GetFloat(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Single

    The value of the specified column.

    Overrides
    DbDataReader.GetFloat(Int32)
    | Improve this Doc View Source

    GetGuid(Int32)

    Gets the value of the specified column as a globally-unique identifier (GUID).

    Declaration
    public override Guid GetGuid(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Guid

    The value of the specified column.

    Overrides
    DbDataReader.GetGuid(Int32)
    | Improve this Doc View Source

    GetInt16(Int32)

    Gets the value of the specified column as a 16-bit signed integer.

    Declaration
    public override short GetInt16(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Int16

    The value of the specified column.

    Overrides
    DbDataReader.GetInt16(Int32)
    | Improve this Doc View Source

    GetInt32(Int32)

    Gets the value of the specified column as a 32-bit signed integer.

    Declaration
    public override int GetInt32(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Int32

    The value of the specified column.

    Overrides
    DbDataReader.GetInt32(Int32)
    | Improve this Doc View Source

    GetInt64(Int32)

    Gets the value of the specified column as a 64-bit signed integer.

    Declaration
    public override long GetInt64(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Int64

    The value of the specified column.

    Overrides
    DbDataReader.GetInt64(Int32)
    | Improve this Doc View Source

    GetName(Int32)

    Gets the name of the column, given the zero-based column ordinal.

    Declaration
    public override string GetName(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    String

    The name of the specified column.

    Overrides
    DbDataReader.GetName(Int32)
    | Improve this Doc View Source

    GetOrdinal(String)

    Gets the column ordinal given the name of the column.

    Declaration
    public override int GetOrdinal(string name)
    Parameters
    Type Name Description
    String name

    The name of the column.

    Returns
    Type Description
    Int32

    The zero-based column ordinal.

    Overrides
    DbDataReader.GetOrdinal(String)
    | Improve this Doc View Source

    GetPostgresType(Int32)

    Gets a representation of the PostgreSQL data type for the specified field. The returned representation can be used to access various information about the field.

    Declaration
    public PostgresType GetPostgresType(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column index.

    Returns
    Type Description
    PostgresType
    | Improve this Doc View Source

    GetProviderSpecificFieldType(Int32)

    Returns the provider-specific field type of the specified column.

    Declaration
    public override Type GetProviderSpecificFieldType(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Type

    The Type object that describes the data type of the specified column.

    Overrides
    DbDataReader.GetProviderSpecificFieldType(Int32)
    | Improve this Doc View Source

    GetProviderSpecificValue(Int32)

    Gets the value of the specified column as an instance of Object.

    Declaration
    public override object GetProviderSpecificValue(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.GetProviderSpecificValue(Int32)
    | Improve this Doc View Source

    GetProviderSpecificValues(Object[])

    Gets all provider-specific attribute columns in the collection for the current row.

    Declaration
    public override int GetProviderSpecificValues(object[] values)
    Parameters
    Type Name Description
    Object[] values

    An array of Object into which to copy the attribute columns.

    Returns
    Type Description
    Int32

    The number of instances of Object in the array.

    Overrides
    DbDataReader.GetProviderSpecificValues(Object[])
    | Improve this Doc View Source

    GetSchemaTable()

    Returns a System.Data.DataTable that describes the column metadata of the DataReader.

    Declaration
    public override DataTable GetSchemaTable()
    Returns
    Type Description
    DataTable
    Overrides
    DbDataReader.GetSchemaTable()
    | Improve this Doc View Source

    GetSchemaTableAsync(CancellationToken)

    Asynchronously returns a System.Data.DataTable that describes the column metadata of the DataReader.

    Declaration
    public Task<DataTable> GetSchemaTableAsync(CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<DataTable>
    | Improve this Doc View Source

    GetStream(Int32)

    Retrieves data as a Stream.

    Declaration
    public override Stream GetStream(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Stream

    The returned object.

    Overrides
    DbDataReader.GetStream(Int32)
    | Improve this Doc View Source

    GetStreamAsync(Int32, CancellationToken)

    Retrieves data as a Stream.

    Declaration
    public Task<Stream> GetStreamAsync(int ordinal, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    Task<Stream>

    The returned object.

    | Improve this Doc View Source

    GetString(Int32)

    Gets the value of the specified column as an instance of String.

    Declaration
    public override string GetString(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    String

    The value of the specified column.

    Overrides
    DbDataReader.GetString(Int32)
    | Improve this Doc View Source

    GetTextReader(Int32)

    Retrieves data as a TextReader.

    Declaration
    public override TextReader GetTextReader(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    TextReader

    The returned object.

    Overrides
    DbDataReader.GetTextReader(Int32)
    | Improve this Doc View Source

    GetTextReaderAsync(Int32, CancellationToken)

    Retrieves data as a TextReader.

    Declaration
    public Task<TextReader> GetTextReaderAsync(int ordinal, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    Task<TextReader>

    The returned object.

    | Improve this Doc View Source

    GetTimeSpan(Int32)

    Gets the value of the specified column as a TimeSpan,

    Declaration
    public TimeSpan GetTimeSpan(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    TimeSpan

    The value of the specified column.

    Remarks

    PostgreSQL's interval type has has a resolution of 1 microsecond and ranges from -178000000 to 178000000 years, while .NET's TimeSpan has a resolution of 100 nanoseconds and ranges from roughly -29247 to 29247 years. See https://www.postgresql.org/docs/current/static/datatype-datetime.html

    | Improve this Doc View Source

    GetValue(Int32)

    Gets the value of the specified column as an instance of Object.

    Declaration
    public override object GetValue(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.GetValue(Int32)
    | Improve this Doc View Source

    GetValues(Object[])

    Populates an array of objects with the column values of the current row.

    Declaration
    public override int GetValues(object[] values)
    Parameters
    Type Name Description
    Object[] values

    An array of Object into which to copy the attribute columns.

    Returns
    Type Description
    Int32

    The number of instances of Object in the array.

    Overrides
    DbDataReader.GetValues(Object[])
    | Improve this Doc View Source

    IsDBNull(Int32)

    Gets a value that indicates whether the column contains nonexistent or missing values.

    Declaration
    public override bool IsDBNull(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column ordinal.

    Returns
    Type Description
    Boolean

    true if the specified column is equivalent to DBNull; otherwise false.

    Overrides
    DbDataReader.IsDBNull(Int32)
    | Improve this Doc View Source

    IsDBNullAsync(Int32, CancellationToken)

    An asynchronous version of IsDBNull(Int32), which gets a value that indicates whether the column contains non-existent or missing values. The cancellationToken parameter is currently ignored.

    Declaration
    public override Task<bool> IsDBNullAsync(int ordinal, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Int32 ordinal

    The zero-based column to be retrieved.

    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    Task<Boolean>

    true if the specified column value is equivalent to DBNull otherwise false.

    Overrides
    DbDataReader.IsDBNullAsync(Int32, CancellationToken)
    | Improve this Doc View Source

    NextResult()

    Advances the reader to the next result when reading the results of a batch of statements.

    Declaration
    public override bool NextResult()
    Returns
    Type Description
    Boolean
    Overrides
    DbDataReader.NextResult()
    | Improve this Doc View Source

    NextResultAsync(CancellationToken)

    This is the asynchronous version of NextResult.

    Declaration
    public override Task<bool> NextResultAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    Task<Boolean>

    A task representing the asynchronous operation.

    Overrides
    DbDataReader.NextResultAsync(CancellationToken)
    | Improve this Doc View Source

    Read()

    Advances the reader to the next record in a result set.

    Declaration
    public override bool Read()
    Returns
    Type Description
    Boolean

    true if there are more rows; otherwise false.

    Overrides
    DbDataReader.Read()
    Remarks

    The default position of a data reader is before the first record. Therefore, you must call Read to begin accessing data.

    | Improve this Doc View Source

    ReadAsync(CancellationToken)

    This is the asynchronous version of Read()

    Declaration
    public override Task<bool> ReadAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    Task<Boolean>

    A task representing the asynchronous operation.

    Overrides
    DbDataReader.ReadAsync(CancellationToken)

    Events

    | Improve this Doc View Source

    ReaderClosed

    Is raised whenever Close() is called.

    Declaration
    public event EventHandler ReaderClosed
    Event Type
    Type Description
    EventHandler

    Explicit Interface Implementations

    | Improve this Doc View Source

    IDbColumnSchemaGenerator.GetColumnSchema()

    Reads a forward-only stream of rows from a data source.

    Declaration
    ReadOnlyCollection<DbColumn> IDbColumnSchemaGenerator.GetColumnSchema()
    Returns
    Type Description
    ReadOnlyCollection<DbColumn>

    Implements

    System.Collections.IEnumerable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable
    System.IAsyncDisposable
    System.Data.Common.IDbColumnSchemaGenerator
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team