OdbcDataReader.GetDateTime(Int32) 方法

定义

DateTime 对象的形式获取指定列的值。Gets the value of the specified column as a DateTime object.

public:
 override DateTime GetDateTime(int i);
public:
 virtual DateTime GetDateTime(int i);
public override DateTime GetDateTime (int i);
public DateTime GetDateTime (int i);
override this.GetDateTime : int -> DateTime
abstract member GetDateTime : int -> DateTime
override this.GetDateTime : int -> DateTime
Public Overrides Function GetDateTime (i As Integer) As DateTime
Public Function GetDateTime (i As Integer) As DateTime

参数

i
Int32

从零开始的列序号。The zero-based column ordinal.

返回

指定列的 DateTime 对象形式的值。The value of the specified column as a DateTime object.

实现

例外

指定的强制转换无效。The specified cast is not valid.

注解

基于 ODBC 驱动程序的基础功能执行转换。Conversions are performed based on the underlying capabilities of the ODBC driver. 如果不支持转换,则方法调用将失败。If the conversion is not supported then the method call will fail.

调用 IsDBNull 在调用此方法之前查找 null 值。Call IsDBNull to look for null values before calling this method.

适用于

另请参阅