SqlDecimal 结构 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示介于 - 10^38 +1 和 10^38 - 1 之间的数值,精度和小数位数固定。
public value class SqlDecimal : IComparable, System::Data::SqlTypes::INullable, System::Xml::Serialization::IXmlSerializablepublic value class SqlDecimal : IComparable, IEquatable<System::Data::SqlTypes::SqlDecimal>, System::Data::SqlTypes::INullable, System::Xml::Serialization::IXmlSerializablepublic value class SqlDecimal : IComparable, System::Data::SqlTypes::INullablepublic struct SqlDecimal : IComparable, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializablepublic struct SqlDecimal : IComparable, IEquatable<System.Data.SqlTypes.SqlDecimal>, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializablepublic struct SqlDecimal : IComparable, System.Data.SqlTypes.INullable[System.Serializable]
public struct SqlDecimal : IComparable, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializabletype SqlDecimal = struct
    interface INullable
    interface IXmlSerializabletype SqlDecimal = struct
    interface INullable[<System.Serializable>]
type SqlDecimal = struct
    interface INullable
    interface IXmlSerializablePublic Structure SqlDecimal
Implements IComparable, INullable, IXmlSerializablePublic Structure SqlDecimal
Implements IComparable, IEquatable(Of SqlDecimal), INullable, IXmlSerializablePublic Structure SqlDecimal
Implements IComparable, INullable- 继承
- 属性
- 实现
注解
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。
构造函数
| 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 结构的新实例。 | 
字段
| MaxPrecision | 一个常量,表示 Precision 属性的最大可能值。 | 
| MaxScale | 一个常量,表示 Scale 属性的最大值。 | 
| MaxValue | 一个常量,表示 SqlDecimal 结构的最大值。 | 
| MinValue | 一个常量,表示 SqlDecimal 结构的最小值。 | 
| Null | 表示可分配给 SqlDecimal 类的此实例的 DBNull。 | 
属性
| BinData | 获取此 SqlDecimal 结构的二进制表示形式作为字节数组。 | 
| Data | 获取此 SqlDecimal 结构的二进制表示形式作为整数数组。 | 
| IsNull | 指示此 SqlDecimal 结构是否为 null。 | 
| IsPositive | 指示此 SqlDecimal 结构的 Value 是否大于零。 | 
| Precision | 获取用于表示 Value 属性的最大位数。 | 
| Scale | 获取解析 Value 的小数位数。 | 
| Value | 获取 SqlDecimal 结构的值。 此属性为只读。 | 
方法
运算符
显式接口实现
| IXmlSerializable.GetSchema() | 此成员支持 .NET Framework 基础结构,不应直接从代码使用。 | 
| IXmlSerializable.ReadXml(XmlReader) | 此成员支持 .NET Framework 基础结构,不应直接从代码使用。 | 
| IXmlSerializable.WriteXml(XmlWriter) | 此成员支持 .NET Framework 基础结构,不应直接从代码使用。 |