DbDataReader Class

Definition

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

public ref class DbDataReader abstract : IDisposable, System::Collections::IEnumerable
public ref class DbDataReader abstract : MarshalByRefObject, IAsyncDisposable, IDisposable, System::Collections::IEnumerable, System::Data::IDataReader
public ref class DbDataReader abstract : IDisposable, System::Collections::IEnumerable, System::Data::IDataReader
public ref class DbDataReader abstract : MarshalByRefObject, IDisposable, System::Collections::IEnumerable, System::Data::IDataReader
public ref class DbDataReader abstract : MarshalByRefObject, System::Collections::IEnumerable, System::Data::IDataReader
public ref class DbDataReader abstract : MarshalByRefObject, IAsyncDisposable, System::Collections::IEnumerable, System::Data::IDataReader
public abstract class DbDataReader : IDisposable, System.Collections.IEnumerable
public abstract class DbDataReader : MarshalByRefObject, IAsyncDisposable, IDisposable, System.Collections.IEnumerable, System.Data.IDataReader
public abstract class DbDataReader : IDisposable, System.Collections.IEnumerable, System.Data.IDataReader
public abstract class DbDataReader : MarshalByRefObject, IDisposable, System.Collections.IEnumerable, System.Data.IDataReader
public abstract class DbDataReader : MarshalByRefObject, System.Collections.IEnumerable, System.Data.IDataReader
public abstract class DbDataReader : MarshalByRefObject, IAsyncDisposable, System.Collections.IEnumerable, System.Data.IDataReader
type DbDataReader = class
    interface IEnumerable
    interface IDisposable
type DbDataReader = class
    inherit MarshalByRefObject
    interface IEnumerable
    interface IDataReader
    interface IDataRecord
    interface IDisposable
    interface IAsyncDisposable
type DbDataReader = class
    interface IEnumerable
    interface IDataReader
    interface IDataRecord
    interface IDisposable
type DbDataReader = class
    inherit MarshalByRefObject
    interface IEnumerable
    interface IDataReader
    interface IDataRecord
    interface IDisposable
type DbDataReader = class
    inherit MarshalByRefObject
    interface IDataReader
    interface IDisposable
    interface IDataRecord
    interface IEnumerable
Public MustInherit Class DbDataReader
Implements IDisposable, IEnumerable
Public MustInherit Class DbDataReader
Inherits MarshalByRefObject
Implements IAsyncDisposable, IDataReader, IDisposable, IEnumerable
Public MustInherit Class DbDataReader
Implements IDataReader, IDisposable, IEnumerable
Public MustInherit Class DbDataReader
Inherits MarshalByRefObject
Implements IDataReader, IDisposable, IEnumerable
Public MustInherit Class DbDataReader
Inherits MarshalByRefObject
Implements IDataReader, IEnumerable
Public MustInherit Class DbDataReader
Inherits MarshalByRefObject
Implements IAsyncDisposable, IDataReader, IEnumerable
Inheritance
DbDataReader
Inheritance
DbDataReader
Derived
Implements

Constructors

DbDataReader()

Initializes a new instance of the DbDataReader class.

Properties

Depth

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

FieldCount

When overridden in a derived class, gets the number of columns in the current row.

HasRows

When overridden in a derived class, gets a value that indicates whether this DbDataReader contains one or more rows.

IsClosed

When overridden in a derived class, gets a value indicating whether the DbDataReader is closed.

Item[Int32]

When overridden in a derived class, gets the value of the specified column as an instance of Object.

Item[String]

When overridden in a derived class, gets the value of the specified column as an instance of Object.

RecordsAffected

When overridden in a derived class, gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

VisibleFieldCount

Gets the number of fields in the DbDataReader that are not hidden.

Methods

Close()

Closes the DbDataReader object.

CloseAsync()

Asynchronously closes the DbDataReader object.

CreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose()

Releases all resources used by the current instance of the DbDataReader class.

Dispose(Boolean)

Releases the unmanaged resources used by the DbDataReader and optionally releases the managed resources.

DisposeAsync()

Asynchronously releases all resources used by the current instance of the DbDataReader class.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetBoolean(Int32)

When overridden in a derived class, gets the value of the specified column as a Boolean.

GetByte(Int32)

When overridden in a derived class, gets the value of the specified column as a byte.

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

When overridden in a derived class, reads a specified number of bytes from the specified column starting at a specified index and writes them to a buffer starting at a specified position in the buffer.

GetChar(Int32)

When overridden in a derived class, gets the value of the specified column as a single character.

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

When overridden in a derived class, reads a specified number of characters from a specified column starting at a specified index, and writes them to a buffer starting at a specified position.

GetColumnSchemaAsync(CancellationToken)

This is the asynchronous version of GetColumnSchema(DbDataReader). Providers should override with an appropriate implementation. The cancellationToken can optionally be honored. The default implementation invokes the synchronous GetColumnSchema(DbDataReader) call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by GetColumnSchema(DbDataReader) will be communicated via the returned Task Exception property.

GetData(Int32)

Returns a nested data reader for the requested column.

GetDataTypeName(Int32)

When overridden in a derived class, gets name of the data type of the specified column.

GetDateTime(Int32)

When overridden in a derived class, gets the value of the specified column as a DateTime object.

GetDbDataReader(Int32)

Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation.

GetDecimal(Int32)

When overridden in a derived class, gets the value of the specified column as a Decimal.

GetDouble(Int32)

When overridden in a derived class, gets the value of the specified column as a double-precision floating point number.

GetEnumerator()

When overridden in a derived class, returns an enumerator that can be used to iterate through the rows in the data reader.

GetFieldType(Int32)

When overridden in a derived class, gets the data type of the specified column.

GetFieldValue<T>(Int32)

Gets the value of the specified column as the requested type.

GetFieldValueAsync<T>(Int32)

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

GetFieldValueAsync<T>(Int32, CancellationToken)

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

GetFloat(Int32)

When overridden in a derived class, gets the value of the specified column as a single-precision floating point number.

GetGuid(Int32)

When overridden in a derived class, gets the value of the specified column as a globally unique identifier (GUID).

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetInt16(Int32)

When overridden in a derived class, gets the value of the specified column as a 16-bit signed integer.

GetInt32(Int32)

When overridden in a derived class, gets the value of the specified column as a 32-bit signed integer.

GetInt64(Int32)

When overridden in a derived class, gets the value of the specified column as a 64-bit signed integer.

GetLifetimeService()
Obsolete.

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetName(Int32)

When overridden in a derived class, gets the name of the column, given the zero-based column ordinal.

GetOrdinal(String)

When overridden in a derived class, gets the column ordinal given the name of the column.

GetProviderSpecificFieldType(Int32)

Gets the provider-specific type of the specified column.

GetProviderSpecificValue(Int32)

Gets the value of the specified column as an instance of a provider-specific type.

GetProviderSpecificValues(Object[])

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

GetSchemaTable()

Returns a DataTable that describes the column metadata of the DbDataReader. Returns null if the executed command returned no resultset, or after NextResult() returns false.

GetSchemaTableAsync(CancellationToken)

This is the asynchronous version of GetSchemaTable(). Providers should override with an appropriate implementation. The cancellationToken can optionally be honored. The default implementation invokes the synchronous GetSchemaTable() call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by GetSchemaTable() will be communicated via the returned Task Exception property.

GetStream(Int32)

Gets a stream to retrieve data from the specified column.

GetString(Int32)

When overridden in a derived class, gets the value of the specified column as an instance of String.

GetTextReader(Int32)

Gets a text reader to retrieve data from the column.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetValue(Int32)

When overridden in a derived class, gets the value of the specified column as an instance of Object.

GetValues(Object[])

When overridden in a derived class, populates an array of objects with the column values of the current row.

InitializeLifetimeService()
Obsolete.

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
IsDBNull(Int32)

When overridden in a derived class, gets a value that indicates whether the column contains nonexistent or missing values.

IsDBNullAsync(Int32)

Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

IsDBNullAsync(Int32, CancellationToken)

Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
NextResult()

When overridden in a derived class, advances the reader to the next result when reading the results of a batch of statements.

NextResultAsync()

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

NextResultAsync(CancellationToken)

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

Read()

When overridden in a derived class, advances the reader to the next record in a result set.

ReadAsync()

Asynchronously advances the reader to the next record in a result set.

ReadAsync(CancellationToken)

Asynchronously advances the reader to the next record in a result set.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IDataReader.Close()

For a description of this member, see Close().

IDataReader.GetSchemaTable()

For a description of this member, see GetSchemaTable().

IDataRecord.GetData(Int32)

For a description of this member, see GetData(Int32).

Extension Methods

CanGetColumnSchema(DbDataReader)

Gets a value that indicates whether a DbDataReader can get a column schema.

GetColumnSchema(DbDataReader)

Gets the column schema (DbColumn collection) for a DbDataReader.

GetBoolean(DbDataReader, String)

Gets the value of the specified column as a Boolean.

GetByte(DbDataReader, String)

Gets the value of the specified column as a byte.

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

Reads a specified number of bytes from the specified column starting at a specified index and writes them to a buffer starting at a specified position in the buffer.

GetChar(DbDataReader, String)

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

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

Reads a specified number of characters from a specified column starting at a specified index, and writes them to a buffer starting at a specified position.

GetData(DbDataReader, String)

Returns a nested data reader for the requested column.

GetDataTypeName(DbDataReader, String)

Gets name of the data type of the specified column.

GetDateTime(DbDataReader, String)

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

GetDecimal(DbDataReader, String)

Gets the value of the specified column as a Decimal.

GetDouble(DbDataReader, String)

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

GetFieldType(DbDataReader, String)

Gets the data type of the specified column.

GetFieldValue<T>(DbDataReader, String)

Gets the value of the specified column as the requested type.

GetFieldValueAsync<T>(DbDataReader, String, CancellationToken)

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

GetFloat(DbDataReader, String)

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

GetGuid(DbDataReader, String)

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

GetInt16(DbDataReader, String)

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

GetInt32(DbDataReader, String)

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

GetInt64(DbDataReader, String)

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

GetProviderSpecificFieldType(DbDataReader, String)

Gets the provider-specific type of the specified column.

GetProviderSpecificValue(DbDataReader, String)

Gets the value of the specified column as an instance of a provider-specific type.

GetStream(DbDataReader, String)

Gets a stream to retrieve data from the specified column.

GetString(DbDataReader, String)

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

GetTextReader(DbDataReader, String)

Gets a text reader to retrieve data from the column.

GetValue(DbDataReader, String)

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

IsDBNull(DbDataReader, String)

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

IsDBNullAsync(DbDataReader, String, CancellationToken)

Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

ConfigureAwait(IAsyncDisposable, Boolean)

Configures how awaits on the tasks returned from an async disposable are performed.

Applies to

See also