JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

The OleDbDataReader Class

The OleDbDataReader class gives you a way of reading a forward-only stream of data rows from a database. Because this stream of data is "forward-only," you can read rows only one after the other, not choose any row you want, or go backward. Data readers are really low-level objects that give you direct access to the data in a database in a way that's not as structured as a dataset, but with faster access. You use this class, the OleDbDataReader class, with OLE DB providers.

To create an OleDbDataReader object, you call the ExecuteReader method of an OleDbCommand object—you don't use a class constructor. You use the Read method of a data reader to read a new row from a database; you can use methods like GetString, GetInt32, and GetBoolean to read the values of the individual fields in the row, one after the other. You also can read a database's XML schema to determine field names and types. See "Using a Data Reader" in the Immediate Solutions for the details and working code.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor