SqlCeDataReader.GetValues 方法
获取当前行中的所有属性列。
命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 System.Data.SqlServerCe.dll 中)
语法
声明
<SecurityTreatAsSafeAttribute> _
<SecurityCriticalAttribute> _
Public Overrides Function GetValues ( _
values As Object() _
) As Integer
用法
Dim instance As SqlCeDataReader
Dim values As Object()
Dim returnValue As Integer
returnValue = instance.GetValues(values)
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public override int GetValues(
Object[] values
)
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public:
virtual int GetValues(
array<Object^>^ values
) override
[<SecurityTreatAsSafeAttribute>]
[<SecurityCriticalAttribute>]
abstract GetValues :
values:Object[] -> int
[<SecurityTreatAsSafeAttribute>]
[<SecurityCriticalAttribute>]
override GetValues :
values:Object[] -> int
public override function GetValues(
values : Object[]
) : int
参数
- values
类型:array<System.Object[]
要将属性列复制到的 Object 数组。
返回值
类型:System.Int32
数组中 Object 的实例的数目。
实现
IDataRecord.GetValues(array<Object[])
异常
异常 | 条件 |
---|---|
InvalidOperationException | 该操作无效。SqlCeDataReader 可能放置在结果集中的最后一行之后。 |
注释
对于大多数应用程序,GetValues 方法提供了一种高效的方法,它检索所有的列,而不是分别检索每个列。
可以传递一个包含列数少于结果行中包含列数的 Object 数组。只有 Object 数组包含的数据量才会复制到数组中。还可以传递其长度大于结果行中所包含列数的 Object 数组。
此方法对于空数据库列返回 DBNull。