System.Data.SqlClient.SqlDataReader.Read Method

Advances the System.Data.SqlClient.SqlDataReader to the next record.

Syntax

public override bool Read ()

Returns

true if there are more rows; otherwise false.

Remarks

The default position of the System.Data.SqlClient.SqlDataReader is before the first record. Therefore, you must call SqlDataReader.Read to begin accessing any data.

Only one SqlDataReader per associated System.Data.SqlClient.SqlConnection may be open at a time, and any attempt to open another will fail until the first one is closed. Similarly, while the SqlDataReader is being used, the associated SqlConnection is busy serving it until you call SqlDataReader.Close.

Requirements

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