DB2DataReader.GetDecimal 方法
以 Decimal 对象形式获取指定列的值。
- 名称空间:
IBM.Data.DB2- 组合件:
IBM.Data.DB2(在IBM.Data.DB2.dll中)
语法
[Visual Basic]
Public Function GetDecimal( _
ByVal i As Integer _
) As Decimal
[C#]
public decimal GetDecimal(
int i
);
[C++]
public: Decimal GetDecimal(
int i
);
[JScript]
public function GetDecimal(
i : int
) : Decimal;
参数
- i
- 从零开始的列序号。
返回值
Decimal 对象形式的指定列的值。
异常
| 异常类型 | 条件 |
|---|---|
| InvalidCastException | 指定的强制类型转换无效。 |
| DB2Exception | 无效的转换。 |
备注
不执行转换。 要检索的数据必须为 DB2Type.Decimal。
下表描述了返回对象数据类型与数据服务器数据类型之间的映射。
| DB2®类型数据类型 | Db2® 数据类型 | Informix® 数据类型 |
|---|---|---|
| Decimal | DECIMAL | MONEY |
在调用此方法前调用 IsDBNull 以检查空值情况。