GetValues Method

Identifies all the attribute columns in the current row.

Syntax

int GetValues( object[ ] values )

Parameters

values – an array of objects that holds an entire row of the result set.

Return Value

The number of objects in the array.

Implements

IDataRecord GetValues

Usage

  • For most applications, the GetValues method provides an efficient means for retrieving all columns, rather than retrieving each column individually.

  • You can pass an Object array that contains fewer than the number of columns contained in the resulting row. Only the amount of data the Object array holds is copied to the array. You can also pass an Object array whose length is more than the number of columns contained in the resulting row.

  • This method returns DBNull for null database columns.

  • Gets the value of the column at the specified ordinal in its native format.