SqlDataRecord.GetSqlValue Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   Microsoft.SqlServer.Server
Assembly:  System.Data (in System.Data.dll)

public virtual object GetSqlValue(
	int ordinal


Type: System.Int32

The zero-based ordinal of the column.

Return Value

Type: System.Object

The value of the column, expressed as a SQL Server type, as a Object.

Exception Condition

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


There is a type mismatch.

For null values, a SQL Server type instance is returned where the IsNull property is true.

.NET Framework
Available since 2.0
Return to top