SqlCeDataReader.GetDecimal 方法
获取指定列的 Decimal 对象形式的值。
命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 system.data.sqlserverce.dll 中)
语法
声明
Public Overrides Function GetDecimal ( _
ordinal As Integer _
) As Decimal
用法
Dim instance As SqlCeDataReader
Dim ordinal As Integer
Dim returnValue As Decimal
returnValue = instance.GetDecimal(ordinal)
public override decimal GetDecimal (
int ordinal
)
public:
virtual Decimal GetDecimal (
int ordinal
) override
public Decimal GetDecimal (
int ordinal
)
public override function GetDecimal (
ordinal : int
) : decimal
不适用。
参数
- ordinal
从零开始的列序号。
返回值
指定列的值。
异常
异常类型 | 条件 |
---|---|
指定的强制转换无效。 |
|
该值为 空引用(在 Visual Basic 中为 Nothing)。 |
|
该操作无效。SqlCeDataReader 可以被放置于结果集的最后一行。 |
备注
不执行任何转换,因此所检索的数据必须已经是 Decimal 对象。
SQL Server Compact Edition 小数的最大大小大于 Decimal 的最大大小。例如,在 SqlCeDataReader 读取大于 Decimal.MaxValue 或小于 Decimal.MinValue 的值时将发生溢出。
调用 IsDBNull 以便在调用此方法之前检查 null 值。
平台
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支持 Microsoft .NET Framework 3.0。
版本信息
.NET Framework
受以下版本支持:3.0
.NET Compact Framework
受以下版本支持:2.0、1.0
请参见
参考
SqlCeDataReader 类
SqlCeDataReader 成员
System.Data.SqlServerCe 命名空间