[ Team LiB ] Previous Section Next Section

IDataRecord

System.Data (system.data.dll) interface

This interface provides access to column values when you use a data reader. You can retrieve a value from a column using the indexer for IDataRecord with the column name or index. Alternatively, you can use one of the typed accessor methods to retrieve a column value by index and convert it to the specified type in one step. For example, GetInt32( ) retrieves the specified column value and casts it to the System.Int32 type. Provider-specific data readers add methods that return data using source-specific data types. You can use the FieldCount property to determine how many columns are in a table. However, if you aren't positioned on a record (for example, you havn't called IDataReader.Read( ) ), this property returns 0.

public interface IDataRecord {
// Public Instance Properties
   public int FieldCount{get; } 
   public object this[string name]{get; } 
   public object this[int i]{get; } 
// Public Instance Methods
   public bool GetBoolean( int i);  
   public byte GetByte( int i);  
   public long GetBytes(int i, long fieldOffset, byte[ ] buffer, int bufferoffset, int length);
   public char GetChar( int i);  
   public long GetChars(int i, long fieldoffset, char[ ] buffer, int bufferoffset, int length);
   public IDataReader GetData( int i);  
   public string GetDataTypeName( int i);  
   public DateTime GetDateTime( int i);  
   public decimal GetDecimal( int i);  
   public double GetDouble( int i);  
   public Type GetFieldType( int i);  
   public float GetFloat( int i);  
   public Guid GetGuid( int i);  
   public short GetInt16( int i);  
   public int GetInt32( int i);  
   public long GetInt64( int i);  
   public string GetName( int i);  
   public int GetOrdinal( string name);  
   public string GetString( int i);  
   public object GetValue( int i);  
   public int GetValues( object[ ] values);  
   public bool IsDBNull( int i);  
}

Implemented By

IDataReader , System.Data.Common.DbDataRecord , System.Data.OleDb.OleDbDataReader , System.Data.OracleClient.OracleDataReader , System.Data.SqlClient.SqlDataReader

    [ Team LiB ] Previous Section Next Section