May 2002
Beginner to intermediate
560 pages
11h 36m
English
DataReader classes do not have a public constructor. They must implement both the IDataReader and the IDataRecord interface. The DataReader class allows the user to read in a forward-only, row-at-a-time fashion and get typed data or generic types from the columns in each row. Listing 8-5 shows IDataReader and IDataRecord.
public interface IDataReader { // IDataReader methods public DataTable GetSchemaTable(); public void Close(); public bool NextResult(); public bool Read(); // IDataReader properties public int Depth public bool IsClosed public int RecordsAffected } public interface IDataRecord { // IDataRecord methods public bool GetBoolean(int i); public byte GetByte(int ... |