Duration (Pacific Standard Time):
To (Pacific Standard Time):
Impact:
  • None
User Action:
  • None

DbDataReader Class

 

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

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)


Public MustInherit Class DbDataReader
	Inherits MarshalByRefObject
	Implements IDataReader, IDisposable, IDataRecord, IEnumerable
Name Description
System_CAPS_protmethod DbDataReader()

Initializes a new instance of the DbDataReader class.

Name Description
System_CAPS_pubproperty Depth

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

System_CAPS_pubproperty FieldCount

Gets the number of columns in the current row.

System_CAPS_pubproperty HasRows

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

System_CAPS_pubproperty IsClosed

Gets a value indicating whether the DbDataReader is closed.

System_CAPS_pubproperty Item[Int32]

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

System_CAPS_pubproperty Item[String]

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

System_CAPS_pubproperty RecordsAffected

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

System_CAPS_pubproperty VisibleFieldCount

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

Name Description
System_CAPS_pubmethod Close()

Closes the DbDataReader object.

System_CAPS_pubmethod 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.)

System_CAPS_pubmethod Dispose()

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

System_CAPS_protmethod Dispose(Boolean)

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

System_CAPS_pubmethod Equals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethod Finalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethod GetBoolean(Int32)

Gets the value of the specified column as a Boolean.

System_CAPS_pubmethod GetByte(Int32)

Gets the value of the specified column as a byte.

System_CAPS_pubmethod 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.

System_CAPS_pubmethod GetChar(Int32)

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

System_CAPS_pubmethod 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.

System_CAPS_pubmethod GetData(Int32)

Returns a DbDataReader object for the requested column ordinal.

System_CAPS_pubmethod GetDataTypeName(Int32)

Gets name of the data type of the specified column.

System_CAPS_pubmethod GetDateTime(Int32)

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

System_CAPS_protmethod GetDbDataReader(Int32)

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

System_CAPS_pubmethod GetDecimal(Int32)

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

System_CAPS_pubmethod GetDouble(Int32)

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

System_CAPS_pubmethod GetEnumerator()

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

System_CAPS_pubmethod GetFieldType(Int32)

Gets the data type of the specified column.

System_CAPS_pubmethod GetFieldValue<T>(Int32)

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

System_CAPS_pubmethod GetFieldValueAsync<T>(Int32)

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

System_CAPS_pubmethod GetFieldValueAsync<T>(Int32, CancellationToken)

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

System_CAPS_pubmethod GetFloat(Int32)

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

System_CAPS_pubmethod GetGuid(Int32)

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

System_CAPS_pubmethod GetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethod GetInt16(Int32)

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

System_CAPS_pubmethod GetInt32(Int32)

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

System_CAPS_pubmethod GetInt64(Int32)

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

System_CAPS_pubmethod GetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethod GetName(Int32)

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

System_CAPS_pubmethod GetOrdinal(String)

Gets the column ordinal given the name of the column.

System_CAPS_pubmethod GetProviderSpecificFieldType(Int32)

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

System_CAPS_pubmethod GetProviderSpecificValue(Int32)

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

System_CAPS_pubmethod GetProviderSpecificValues(Object[])

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

System_CAPS_pubmethod GetSchemaTable()

Returns a DataTable that describes the column metadata of the DbDataReader.

System_CAPS_pubmethod GetStream(Int32)

Retrieves data as a Stream.

System_CAPS_pubmethod GetString(Int32)

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

System_CAPS_pubmethod GetTextReader(Int32)

Retrieves data as a TextReader.

System_CAPS_pubmethod GetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethod GetValue(Int32)

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

System_CAPS_pubmethod GetValues(Object[])

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

System_CAPS_pubmethod InitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethod IsDBNull(Int32)

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

System_CAPS_pubmethod IsDBNullAsync(Int32)

An asynchronous version of IsDBNull, which gets a value that indicates whether the column contains non-existent or missing values.

System_CAPS_pubmethod IsDBNullAsync(Int32, CancellationToken)

An asynchronous version of IsDBNull, which gets a value that indicates whether the column contains non-existent or missing values. Optionally, sends a notification that operations should be cancelled.

System_CAPS_protmethod MemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethod NextResult()

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

System_CAPS_pubmethod NextResultAsync()

An asynchronous version of NextResult, which advances the reader to the next result when reading the results of a batch of statements.

Invokes NextResultAsync with CancellationToken.None.

System_CAPS_pubmethod NextResultAsync(CancellationToken)

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

The default implementation invokes the synchronous NextResult 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 NextResult will be communicated via the returned Task Exception property.

Other methods and properties of the DbDataReader object should not be invoked while the returned Task is not yet completed.

System_CAPS_pubmethod Read()

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

System_CAPS_pubmethod ReadAsync()

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

System_CAPS_pubmethod 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.

System_CAPS_pubmethod ToString()

Returns a string that represents the current object.(Inherited from Object.)

Name Description
System_CAPS_pubinterface System_CAPS_privmethod IDataRecord.GetData(Int32)

For a description of this member, see IDataRecord.GetData.

Name Description
System_CAPS_pubmethod AsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethod AsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethod Cast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethod OfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top