IDataRecord.GetValues(Object[]) 方法

定义

使用当前记录的列值填充对象的数组。Populates an array of objects with the column values of the current record.

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

参数

values
Object[]

要将属性字段复制到其中的 Object 数组。An array of Object to copy the attribute fields into.

返回

数组中 Object 的实例的数目。The number of instances of Object in the array.

注解

对于大多数应用程序, GetValues方法提供了一种有效的方法来检索所有列, 而不是单独检索每个列。For most applications, the GetValues method provides an efficient means for retrieving all columns, instead of retrieving each column individually.

可以传递一个Object数组, 该数组包含的列数少于所产生行中包含的列数。You can pass an Object array that contains fewer than the number of columns that are contained in the resulting row. 只有Object数组保存的数据量会复制到数组中。Only the amount of data the Object array holds is copied to the array. 还可以传递Object其长度大于结果行中包含的列数的数组。You can also pass an Object array whose length is more than the number of columns that are contained in the resulting row.

适用于