SqlDecimal 結構
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示介於 - 10^38 +1 和 10^38 - 1 之間的數值,具有固定有效位數和小數位數。
public value class SqlDecimal : IComparable, System::Data::SqlTypes::INullable
public value class SqlDecimal : IComparable, System::Data::SqlTypes::INullable, System::Xml::Serialization::IXmlSerializable
public struct SqlDecimal : IComparable, System.Data.SqlTypes.INullable
[System.Serializable]
public struct SqlDecimal : IComparable, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializable
public struct SqlDecimal : IComparable, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializable
type SqlDecimal = struct
interface INullable
[<System.Serializable>]
type SqlDecimal = struct
interface INullable
interface IXmlSerializable
type SqlDecimal = struct
interface INullable
interface IXmlSerializable
Public Structure SqlDecimal
Implements IComparable, INullable
Public Structure SqlDecimal
Implements IComparable, INullable, IXmlSerializable
- 繼承
- 屬性
- 實作
備註
SqlDecimal 的底層資料結構與其對應的 .NET Framework Decimal 資料型態不同。 Decimal 沒有精確度的概念。 它使用 3 個 DWORD(12 位元組)來儲存實際資料,因此最大縮放範圍為 28。 資料範圍為 -79,228,162,514,264,337,593,543,950,335 至 79,228,162,514,264,337,593,543,950,335。 SqlDecimal 同時具備精準度與規模。 它使用 4 個無符號的 4 位元組整數來儲存實際資料,因此最大精度與縮放率為 38。 資料範圍為 - 10^38 +1 至 10^38 - 1。
建構函式
| 名稱 | Description |
|---|---|
| SqlDecimal(Byte, Byte, Boolean, Int32, Int32, Int32, Int32) |
使用所提供的參數初始化結構的新實例 SqlDecimal 。 |
| SqlDecimal(Byte, Byte, Boolean, Int32[]) |
使用所提供的參數初始化結構的新實例 SqlDecimal 。 |
| SqlDecimal(Decimal) |
使用所Decimal提供的值初始化結構的新實例SqlDecimal。 |
| SqlDecimal(Double) |
使用提供的雙重參數初始化結構的新實例 SqlDecimal 。 |
| SqlDecimal(Int32) |
使用所提供的整數值初始化結構的新實例 SqlDecimal 。 |
| SqlDecimal(Int64) |
使用提供的長整數值初始化結構的新實例 SqlDecimal 。 |
欄位
| 名稱 | Description |
|---|---|
| MaxPrecision |
一個常數代表該財產的最大可能值 Precision 。 |
| MaxScale |
一個常數代表該性質的最大 Scale 值。 |
| MaxValue |
一個常數代表結構的最大 SqlDecimal 值。 |
| MinValue |
一個常數,代表結構的 SqlDecimal 最小值。 |
| Null |
代表可指派給該類別實例SqlDecimal的 aDBNull。 |
屬性
| 名稱 | Description |
|---|---|
| BinData |
以位元組陣列的形式表示此 SqlDecimal 結構的值。 |
| Data |
取得此 SqlDecimal 結構的二進位表示,為整數陣列。 |
| IsNull |
表示此 SqlDecimal 結構是否為零。 |
| IsPositive |
表示該SqlDecimal結構的 是否Value大於零。 |
| Precision |
取得代表 Value 該屬性的最大數字數。 |
| Scale |
得到被解析到 Value 的小數點數。 |
| Value |
了解結構的 SqlDecimal 價值。 這個屬性是唯讀的。 |
方法
操作員
明確介面實作
| 名稱 | Description |
|---|---|
| IXmlSerializable.GetSchema() |
此成員支援 .NET Framework 基礎架構,並非直接從您的程式碼中使用。 |
| IXmlSerializable.ReadXml(XmlReader) |
此成員支援 .NET Framework 基礎架構,並非直接從您的程式碼中使用。 |
| IXmlSerializable.WriteXml(XmlWriter) |
此成員支援 .NET Framework 基礎架構,並非直接從您的程式碼中使用。 |