System.Data.Odbc.OdbcDataReader Class

Provides a way of reading a forward-only stream of data rows from a data source. This class cannot be inherited.

See Also: OdbcDataReader Members

Syntax

public sealed class OdbcDataReader : System.Data.Common.DbDataReader

Remarks

To create an System.Data.Odbc.OdbcDataReader, you must call the OdbcCommand.ExecuteReader method of the System.Data.Odbc.OdbcCommand object, instead of directly using a constructor.

While the System.Data.Odbc.OdbcDataReader is being used, the associated System.Data.Odbc.OdbcConnection is busy serving the System.Data.Odbc.OdbcDataReader, and no other operations can be performed on the System.Data.Odbc.OdbcConnection other than closing it. This is the case until the OdbcDataReader.Close method of the System.Data.Odbc.OdbcDataReader is called. For example, you cannot retrieve output parameters until after you call OdbcDataReader.Close.

Changes made to a result set by another process or thread while data is being read may be visible to the user of the System.Data.Odbc.OdbcDataReader. However, the precise behavior is both driver and timing dependent.

OdbcDataReader.IsClosed and OdbcDataReader.RecordsAffected are the only properties that you can call after the System.Data.Odbc.OdbcDataReader is closed. Sometimes, you must call OdbcDataReader.Close before you can call OdbcDataReader.RecordsAffected.

Requirements

Namespace: System.Data.Odbc
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0