System.Data.OleDb.OleDbDataReader Class

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

See Also: OleDbDataReader Members


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


To create an System.Data.OleDb.OleDbDataReader, you must call the OleDbCommand.ExecuteReader method of the System.Data.OleDb.OleDbCommand object, instead of directly using a constructor.

Before you close the System.Data.OleDb.OleDbConnection, first close the System.Data.OleDb.OleDbDataReader object. You must also close the System.Data.OleDb.OleDbDataReader object if you plan to resuse an System.Data.OleDb.OleDbCommand object.For example, you cannot retrieve output parameters until after you call OleDbDataReader.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.OleDb.OleDbDataReader. However, the precise behavior is timing dependent.

OleDbDataReader.IsClosed and OleDbDataReader.RecordsAffected are the only properties that you can call after the System.Data.OleDb.OleDbDataReader is closed. Although the OleDbDataReader.RecordsAffected property may be accessed while the System.Data.OleDb.OleDbDataReader exists, always call OleDbDataReader.Close before returning the value of OleDbDataReader.RecordsAffected to guarantee an accurate return value.


Namespace: System.Data.OleDb
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,