SqlDataRecord.GetValues(Object[]) SqlDataRecord.GetValues(Object[]) SqlDataRecord.GetValues(Object[]) SqlDataRecord.GetValues(Object[]) Method

定义

返回记录中所有列的值,这些值在数组中表示为公共语言运行时 (CLR) 类型。Returns the values for all the columns in the record, expressed as common language runtime (CLR) types, in an array.

public:
 virtual int GetValues(cli::array <System::Object ^> ^ values);
public virtual int GetValues (object[] values);
abstract member GetValues : obj[] -> int
override this.GetValues : obj[] -> int
Public Overridable Function GetValues (values As Object()) As Integer

参数

values
Object[]

要将值列值复制到其中的数组。The array into which to copy the values column values.

返回

指示复制的列数的 Int32An Int32 that indicates the number of columns copied.

实现

异常

注解

列的 CLR 类型值将复制到作为参数传递values的数组中。The CLR type values of the column are copied into the values array that is passed as a parameter. 对于具有 null 值的列Value , 将返回。For columns with null value, Value is returned.

values数组的长度不需要与记录中的列数匹配。The length of the values array does not need to match the number of columns in the record. 如果数组长度大于列数, 则所有列值都将复制到数组中;如果小于, 则仅将列值的数组长度复制到数组中, 并从序号为0的列值开始复制到数组中。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.

适用于