GetValues Method
Collapse the table of content
Expand the table of content

SqlDataRecord.GetValues Method

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

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

public int GetValues(
	Object[] 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.




values is null.


There is a type mismatch.

The CLR type values of the column are copied into the values array that is passed as a parameter. For columns with null value, Value is returned.

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 is copied into the array, starting at the column value with ordinal 0.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

© 2016 Microsoft