Expand Minimize

SqlDataRecord.GetSqlValues Method

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

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

public virtual int GetSqlValues(
	Object[] values
)

Parameters

values
Type: System.Object[]

The array into which to copy the values column values.

Return Value

Type: System.Int32
An Int32 that indicates the number of columns copied.

ExceptionCondition
ArgumentNullException

values is null.

InvalidCastException

There is a type mismatch.

The SQL Server type values of the column are copied into the values array that is passed as a parameter. For null values, a Sql type instance is returned where the IsNull property is true.

The length of the values array does not need to match the number of columns in the record. If the array length is greater than the number of columns, all of the column values are copied into the array; if it is less, only the array length number of column values are copied into the array, starting at the column value with ordinal 0.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft