<PackageReference Include="System.Data.SqlClient" Version="4.7.0-preview.19073.11" />

SqlDataRecord

public class SqlDataRecord : IDataRecord
Represents a single row of data and its metadata. This class cannot be inherited.
public virtual int FieldCount { get; }

Gets the number of columns in the data row. This property is read-only.

public virtual object this[int ordinal] { get; }

Gets the common language runtime (CLR) type value for the column specified by the column ordinalordinal argument.

public virtual object this[string name] { get; }

Gets the common language runtime (CLR) type value for the column specified by the column namename argument.

public SqlDataRecord(SqlMetaData[] metaData)

Inititializes a new SqlDataRecord instance with the schema based on the array of SqlMetaData objects passed as an argument.

public virtual bool GetBoolean(int ordinal)

Gets the value for the column specified by the ordinal as a Boolean.

public virtual byte GetByte(int ordinal)

Gets the value for the column specified by the ordinal as a Byte.

public virtual long GetBytes(int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length)

Gets the value for the column specified by the ordinal as an array of Byte objects.

public virtual char GetChar(int ordinal)

Gets the value for the column specified by the ordinal as a Char.

public virtual long GetChars(int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length)

Gets the value for the column specified by the ordinal as an array of Char objects.

public virtual string GetDataTypeName(int ordinal)

Returns the name of the data type for the column specified by the ordinal argument.

public virtual DateTime GetDateTime(int ordinal)

Gets the value for the column specified by the ordinal as a DateTime.

public virtual DateTimeOffset GetDateTimeOffset(int ordinal)

Returns the specified column’s data as a DateTimeOffset.

public virtual decimal GetDecimal(int ordinal)

Gets the value for the column specified by the ordinal as a Decimal.

public virtual double GetDouble(int ordinal)

Gets the value for the column specified by the ordinal as a Double.

public virtual Type GetFieldType(int ordinal)

Returns a Type object representing the common language runtime (CLR) type that maps to the SQL Server type of the column specified by the ordinalordinal argument.

public virtual float GetFloat(int ordinal)

Gets the value for the column specified by the ordinal as a float.

public virtual Guid GetGuid(int ordinal)

Gets the value for the column specified by the ordinal as a Guid.

public virtual short GetInt16(int ordinal)

Gets the value for the column specified by the ordinal as a Int16.

public virtual int GetInt32(int ordinal)

Gets the value for the column specified by the ordinal as a Int32.

public virtual long GetInt64(int ordinal)

Gets the value for the column specified by the ordinal as a Int64.

public virtual string GetName(int ordinal)

Returns the name of the column specified by the ordinal argument.

public virtual int GetOrdinal(string name)

Returns the column ordinal specified by the column name.

public virtual SqlBinary GetSqlBinary(int ordinal)

Gets the value for the column specified by the ordinal as a SqlBinary.

public virtual SqlBoolean GetSqlBoolean(int ordinal)

Gets the value for the column specified by the ordinal as a SqlBoolean.

public virtual SqlByte GetSqlByte(int ordinal)

Gets the value for the column specified by the ordinal as a SqlByte.

public virtual SqlBytes GetSqlBytes(int ordinal)

Gets the value for the column specified by the ordinal as a SqlBytes.

public virtual SqlChars GetSqlChars(int ordinal)

Gets the value for the column specified by the ordinal as a SqlChars.

public virtual SqlDateTime GetSqlDateTime(int ordinal)

Gets the value for the column specified by the ordinal as a SqlDateTime.

public virtual SqlDecimal GetSqlDecimal(int ordinal)

Gets the value for the column specified by the ordinal as a SqlDecimal.

public virtual SqlDouble GetSqlDouble(int ordinal)

Gets the value for the column specified by the ordinal as a SqlDouble.

public virtual Type GetSqlFieldType(int ordinal)

Returns a Type object that represents the type (as a SQL Server type, defined in SqlTypes) that maps to the SQL Server type of the column.

public virtual SqlGuid GetSqlGuid(int ordinal)

Gets the value for the column specified by the ordinal as a SqlGuid.

public virtual SqlInt16 GetSqlInt16(int ordinal)

Gets the value for the column specified by the ordinal as a SqlInt16.

public virtual SqlInt32 GetSqlInt32(int ordinal)

Gets the value for the column specified by the ordinal as a SqlInt32.

public virtual SqlInt64 GetSqlInt64(int ordinal)

Gets the value for the column specified by the ordinal as a SqlInt64.

public virtual SqlMetaData GetSqlMetaData(int ordinal)

Returns a SqlMetaData object, describing the metadata of the column specified by the column ordinal.

public virtual SqlMoney GetSqlMoney(int ordinal)

Gets the value for the column specified by the ordinal as a SqlMoney.

public virtual SqlSingle GetSqlSingle(int ordinal)

Gets the value for the column specified by the ordinal as a SqlSingle.

public virtual SqlString GetSqlString(int ordinal)

Gets the value for the column specified by the ordinal as a SqlString.

public virtual object GetSqlValue(int ordinal)

Returns the data value stored in the column, expressed as a SQL Server type, specified by the column ordinal.

public virtual int GetSqlValues(object[] values)

Returns the values for all the columns in the record, expressed as SQL Server types, in an array.

public virtual SqlXml GetSqlXml(int ordinal)

Gets the value for the column specified by the ordinal as a SqlXml.

public virtual string GetString(int ordinal)

Gets the value for the column specified by the ordinal as a String.

public virtual TimeSpan GetTimeSpan(int ordinal)

Returns the specified column’s data as a TimeSpan.

public virtual object GetValue(int ordinal)

Returns the common language runtime (CLR) type value for the column specified by the ordinal argument.

public virtual int GetValues(object[] values)

Returns the values for all the columns in the record, expressed as common language runtime (CLR) types, in an array.

public virtual bool IsDBNull(int ordinal)

Returns true if the column specified by the column ordinal parameter is null.

public virtual void SetBoolean(int ordinal, bool value)

Sets the data stored in the column to the specified Boolean value.

public virtual void SetByte(int ordinal, byte value)

Sets the data stored in the column to the specified Byte value.

public virtual void SetBytes(int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length)

Sets the data stored in the column to the specified array of Byte values.

public virtual void SetChar(int ordinal, char value)

Sets the data stored in the column to the specified Char value.

public virtual void SetChars(int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length)

Sets the data stored in the column to the specified array of Char values.

public virtual void SetDateTime(int ordinal, DateTime value)

Sets the data stored in the column to the specified DateTime value.

public virtual void SetDateTimeOffset(int ordinal, DateTimeOffset value)

Sets the value of the column specified to the DateTimeOffset value.

public virtual void SetDBNull(int ordinal)

Sets the value in the specified column to DBNull.

public virtual void SetDecimal(int ordinal, decimal value)

Sets the data stored in the column to the specified Decimal value.

public virtual void SetDouble(int ordinal, double value)

Sets the data stored in the column to the specified Double value.

public virtual void SetFloat(int ordinal, float value)

Sets the data stored in the column to the specified float value.

public virtual void SetGuid(int ordinal, Guid value)

Sets the data stored in the column to the specified Guid value.

public virtual void SetInt16(int ordinal, short value)

Sets the data stored in the column to the specified Int16 value.

public virtual void SetInt32(int ordinal, int value)

Sets the data stored in the column to the specified Int32 value.

public virtual void SetInt64(int ordinal, long value)

Sets the data stored in the column to the specified Int64 value.

public virtual void SetSqlBinary(int ordinal, SqlBinary value)

Sets the data stored in the column to the specified SqlBinary value.

public virtual void SetSqlBoolean(int ordinal, SqlBoolean value)

Sets the data stored in the column to the specified SqlBoolean value.

public virtual void SetSqlByte(int ordinal, SqlByte value)

Sets the data stored in the column to the specified SqlByte value.

public virtual void SetSqlBytes(int ordinal, SqlBytes value)

Sets the data stored in the column to the specified SqlBytes value.

public virtual void SetSqlChars(int ordinal, SqlChars value)

Sets the data stored in the column to the specified SqlChars value.

public virtual void SetSqlDateTime(int ordinal, SqlDateTime value)

Sets the data stored in the column to the specified SqlDateTime value.

public virtual void SetSqlDecimal(int ordinal, SqlDecimal value)

Sets the data stored in the column to the specified SqlDecimal value.

public virtual void SetSqlDouble(int ordinal, SqlDouble value)

Sets the data stored in the column to the specified SqlDouble value.

public virtual void SetSqlGuid(int ordinal, SqlGuid value)

Sets the data stored in the column to the specified SqlGuid value.

public virtual void SetSqlInt16(int ordinal, SqlInt16 value)

Sets the data stored in the column to the specified SqlInt16 value.

public virtual void SetSqlInt32(int ordinal, SqlInt32 value)

Sets the data stored in the column to the specified SqlInt32 value.

public virtual void SetSqlInt64(int ordinal, SqlInt64 value)

Sets the data stored in the column to the specified SqlInt64 value.

public virtual void SetSqlMoney(int ordinal, SqlMoney value)

Sets the data stored in the column to the specified SqlMoney value.

public virtual void SetSqlSingle(int ordinal, SqlSingle value)

Sets the data stored in the column to the specified SqlSingle value.

public virtual void SetSqlString(int ordinal, SqlString value)

Sets the data stored in the column to the specified SqlString value.

public virtual void SetSqlXml(int ordinal, SqlXml value)

Sets the data stored in the column to the specified SqlXml value.

public virtual void SetString(int ordinal, string value)

Sets the data stored in the column to the specified String value.

public virtual void SetTimeSpan(int ordinal, TimeSpan value)

Sets the value of the column specified to the TimeSpan.

public virtual void SetValue(int ordinal, object value)

Sets a new value, expressed as a common language runtime (CLR) type, for the column specified by the column ordinal.

public virtual int SetValues(object[] values)

Sets new values for all of the columns in the SqlDataRecord. These values are expressed as common language runtime (CLR) types.