IDataReader.Read Method ()

 

Advances the IDataReader to the next record.

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

abstract Read : unit -> bool

Return Value

Type: System.Boolean

true if there are more rows; otherwise, false.

The default position of the IDataReader is prior to the first record. Therefore you must call Read to begin accessing any data.

While the data reader is in use, the associated connection is busy serving the IDataReader. This is the case until Close is called.

The following example creates instances of three derived classes OleDbConnection, an OleDbCommand, and an OleDbDataReader. The example reads through the data, writing it out to the console. Finally, the example closes the OleDbDataReader, then the OleDbConnection.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: