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 ...
Get ADO.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.