Name
IDataRecord
Synopsis
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[stringname]{get; } public object this[inti]{get; } // Public Instance Methods public bool GetBoolean(inti); public byte GetByte(inti); public long GetBytes(inti, longfieldOffset, byte[ ]buffer, intbufferoffset, intlength); public char GetChar(inti); public long GetChars(inti, longfieldoffset, char[ ]buffer, intbufferoffset, intlength); public IDataReader GetData(inti); public string GetDataTypeName(inti); public DateTime GetDateTime(inti); public decimal GetDecimal(inti); public double GetDouble(inti); public Type GetFieldType(inti); public float GetFloat(inti); public Guid GetGuid(inti); public short GetInt16 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access