Condividi tramite


SqlCeDataReader.GetDecimal Method

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets the value of the specified column as a Decimal object.

  [Visual Basic]
  Public Overridable Function GetDecimal( _
   ByVal 
  ordinal
   As Integer _
) As Decimal Implements IDataRecord.GetDecimal
[C#]
public virtual decimal GetDecimal(int ordinal
);
[C++]
public: virtual Decimal GetDecimal(int ordinal
);
[JScript]
public function GetDecimal(
   ordinal : int) : Decimal;

Parameters

  • ordinal
    The zero-based column ordinal.

Return Value

The value of the specified column.

Implements

IDataRecord.GetDecimal

Exceptions

Exception Type Condition
InvalidCastException The specified cast is not valid.
SqlNullValueException The value is null.
InvalidOperationException The operation is not valid. The SqlCeDataReader may be positioned after the last row in the result set.

Remarks

No conversions are performed; therefore, the data retrieved must already be a Decimal object.

The maximum size of the SQL Server CE decimal is greater than the maximum size of Decimal. For example, an overflow can occur when SqlCeDataReader is reading values that are either greater than Decimal.MaxValue or lesser than Decimal.MinValue.

Call IsDBNull to check for null values before calling this method.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeDataReader Class | SqlCeDataReader Members | System.Data.SqlServerCe Namespace

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.