SqlDataRecord.Item[] Property

Definition

Overloads

Item[Int32]

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

Item[String]

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

Item[Int32]

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

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

Parameters

ordinal
Int32

The zero-based ordinal of the column.

Property Value

The CLR type value of the column specified by the ordinal.

Implements

Exceptions

The ordinal is less than 0 or greater than the number of columns (that is, FieldCount).

Remarks

For columns with null value, Value is returned.

Applies to

SqlClient .NET Core 5.2 and other versions
Product Versions
SqlClient .NET Core 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Framework 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Standard 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2

Item[String]

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

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

Parameters

name
String

The name of the column.

Property Value

The CLR type value of the column specified by the name.

Implements

Remarks

For columns with null value, Value is returned.

Applies to

SqlClient .NET Core 5.2 and other versions
Product Versions
SqlClient .NET Core 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Framework 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Standard 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2