''SqlDataReader'' ''marshal by reference, disposable'

SqlDataReader marshal by reference, disposable

System.Data.SqlClient (system.data.dll) sealed class

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
   public long GetChars(int i, long dataIndex, char[  ] buffer, int bufferIndex, int length); 
// implements System.Data.IDataRecord
   public IDataReader GetData( int i);                         // implements System.Data.IDataRecord
   public string GetDataTypeName( int i);                      // implements System.Data.IDataRecord
   public DateTime GetDateTime( int i);                        // implements System.Data.IDataRecord
   public decimal GetDecimal( int i);                          // implements System.Data.IDataRecord
   public double GetDouble( int i);                            // implements System.Data.IDataRecord
   public Type GetFieldType( int i);                           // implements System.Data.IDataRecord
   public float GetFloat( int i);                              // implements System.Data.IDataRecord
   public Guid GetGuid( int i);                                // implements System.Data.IDataRecord
   public short GetInt16( int i);                              // implements System.Data.IDataRecord
   public int GetInt32( int i);                                // implements System.Data.IDataRecord
   public long GetInt64( int i);                               // implements System.Data.IDataRecord
   public string GetName( int i);                              // implements System.Data.IDataRecord
   public int GetOrdinal( string name);                        // implements System.Data.IDataRecord
   public DataTable GetSchemaTable(  );                          // implements System.Data.IDataReader
   public SqlBinary GetSqlBinary( int i);  
  public SqlBoolean GetSqlBoolean( int i);
  public SqlByte GetSqlByte( int i);
   public SqlDateTime GetSqlDateTime( int i);  
   public SqlDecimal GetSqlDecimal( int i);  
   public SqlDouble GetSqlDouble( int i);  
   public SqlGuid GetSqlGuid( int i);  
   public SqlInt16 GetSqlInt16( int i);  
   public SqlInt32 GetSqlInt32( int i);  
   public SqlInt64 GetSqlInt64( int i);  
   public SqlMoney GetSqlMoney( int i);  
   public SqlSingle GetSqlSingle( int i);  
   public SqlString GetSqlString( int i);  
   public object GetSqlValue( int i);  
   public int GetSqlValues( object[  ] values);  
   public string GetString( int i);                            // implements System.Data.IDataRecord
   public object GetValue( int i);                             // implements System.Data.IDataRecord
   public int GetValues( object[  ] values);                     // implements System.Data.IDataRecord
   public bool IsDBNull( int i);                               // implements System.Data.IDataRecord
   public bool NextResult(  );                                   // implements System.Data.IDataReader
   public bool Read(  );                                         // implements System.Data.IDataReader
}

Hierarchy

System.Object figs/U2192.gif System.MarshalByRefObject figs/U2192.gif SqlDataReader(System.Collections.IEnumerable, System.Data.IDataReader , System.IDisposable , System.Data.IDataRecord)

Returned By

SqlCommand.ExecuteReader( )



    Part I: ADO.NET Tutorial
    Part II: ADO.NET Core Classes
    Part III: API Quick Reference
    Chapter 34. The System.Data Namespace