Name

SqlDataReader

Synopsis

This class represents a forward-only, read-only cursor that reads data from a SQL Server database and allows you to access it one record at a time. For information about the basic SqlDataReader methods and properties, refer to the reference for the System.Data.IDataReader and System.Data.IDataRecord interfaces, which SqlDataReader implements. In addition, you’ll find that SqlDataReader adds many methods that retrieve data in native SQL Server data types.

public sealed class SqlDataReader : MarshalByRefObject, IEnumerable, System.Data.IDataReader, 

       IDisposable, System.Data IDataRecord {

// Public Instance Properties

   public int Depth{get; }                                     // implements System.Data.IDataReader

   public int FieldCount{get; }                                // implements System.Data.IDataRecord

   public bool HasRows{get; } 

   public bool IsClosed{get; }                                 // implements System.Data.IDataReader

   public int RecordsAffected{get; }                           // implements System.Data.IDataReader

   public object this[int 

                  i

                  ]{get; }                                   // implements System.Data.IDataRecord

   public object this[string 

                  name

                  ]{get; }                                   // implements System.Data.IDataRecord

                  // Public Instance Methods

   public void Close( );                                        // implements System.Data.IDataReader

   public bool GetBoolean(int i);                             // implements System.Data.IDataRecord

   public byte GetByte(int i);                                // implements System.Data.IDataRecord

   public long GetBytes(int i, long dataIndex, byte[  ] buffer, int bufferIndex, int length);  

                  // implements System.Data.IDataRecord

   public char GetChar(int i);                                // implements System.Data.IDataRecord ...

Get ADO.NET in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.