SqlDecimal Structure
TOC
Collapse the table of content
Expand the table of content

SqlDecimal Structure

 

Represents a numeric value between - 10^38 +1 and 10^38 - 1, with fixed precision and scale.

Namespace:   System.Data.SqlTypes
Assembly:  System.Data (in System.Data.dll)

[SerializableAttribute]
public struct SqlDecimal : INullable, IComparable, IXmlSerializable

NameDescription
System_CAPS_pubmethodSqlDecimal(Byte, Byte, Boolean, Int32, Int32, Int32, Int32)

Initializes a new instance of the SqlDecimal structure using the supplied parameters.

System_CAPS_pubmethodSqlDecimal(Byte, Byte, Boolean, Int32[])

Initializes a new instance of the SqlDecimal structure using the supplied parameters.

System_CAPS_pubmethodSqlDecimal(Decimal)

Initializes a new instance of the SqlDecimal structure using the supplied Decimal value.

System_CAPS_pubmethodSqlDecimal(Double)

Initializes a new instance of the SqlDecimal structure using the supplied double parameter.

System_CAPS_pubmethodSqlDecimal(Int32)

Initializes a new instance of the SqlDecimal structure using the supplied integer value.

System_CAPS_pubmethodSqlDecimal(Int64)

Initializes a new instance of the SqlDecimal structure using the supplied long integer value.

NameDescription
System_CAPS_pubpropertyBinData

Get the binary representation of the value of this SqlDecimal structure as an array of bytes.

System_CAPS_pubpropertyData

Gets the binary representation of this SqlDecimal structure as an array of integers.

System_CAPS_pubpropertyIsNull

Indicates whether this SqlDecimal structure is null.

System_CAPS_pubpropertyIsPositive

Indicates whether the Value of this SqlDecimal structure is greater than zero.

System_CAPS_pubpropertyPrecision

Gets the maximum number of digits used to represent the Value property.

System_CAPS_pubpropertyScale

Gets the number of decimal places to which Value is resolved.

System_CAPS_pubpropertyValue

Gets the value of the SqlDecimal structure. This property is read-only.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAbs(SqlDecimal)

The Abs method gets the absolute value of the SqlDecimal parameter.

System_CAPS_pubmethodSystem_CAPS_staticAdd(SqlDecimal, SqlDecimal)

Calculates the sum of the two SqlDecimal operators.

System_CAPS_pubmethodSystem_CAPS_staticAdjustScale(SqlDecimal, Int32, Boolean)

The scale of the SqlDecimal operand will be adjusted to the number of digits indicated by the digits parameter. Depending on the value of the fRound parameter, the value will either be rounded to the appropriate number of digits or truncated.

System_CAPS_pubmethodSystem_CAPS_staticCeiling(SqlDecimal)

Returns the smallest whole number greater than or equal to the specified SqlDecimal structure.

System_CAPS_pubmethodCompareTo(Object)

Compares this SqlDecimal instance to the supplied Object and returns an indication of their relative values.

System_CAPS_pubmethodCompareTo(SqlDecimal)

Compares this SqlDecimal instance to the supplied SqlDecimal object and returns an indication of their relative values.

System_CAPS_pubmethodSystem_CAPS_staticConvertToPrecScale(SqlDecimal, Int32, Int32)

Adjusts the value of the SqlDecimal operand to the indicated precision and scale.

System_CAPS_pubmethodSystem_CAPS_staticDivide(SqlDecimal, SqlDecimal)

The division operator calculates the results of dividing the first SqlDecimal operand by the second.

System_CAPS_pubmethodEquals(Object)

Compares the supplied Object parameter to the Value property of the SqlDecimal instance.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodSystem_CAPS_staticEquals(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal operands to determine whether they are equal.

System_CAPS_pubmethodSystem_CAPS_staticFloor(SqlDecimal)

Rounds a specified SqlDecimal number to the next lower whole number.

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetXsdType(XmlSchemaSet)

Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet.

System_CAPS_pubmethodSystem_CAPS_staticGreaterThan(SqlDecimal, SqlDecimal)

Performs a logical comparison of two SqlDecimal structures to determine whether the first is greater than the second.

System_CAPS_pubmethodSystem_CAPS_staticGreaterThanOrEqual(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is greater than or equal to the second.

System_CAPS_pubmethodSystem_CAPS_staticLessThan(SqlDecimal, SqlDecimal)

Performs a logical comparison of two SqlDecimal structures to determine whether the first is less than the second.

System_CAPS_pubmethodSystem_CAPS_staticLessThanOrEqual(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is less than or equal to the second.

System_CAPS_pubmethodSystem_CAPS_staticMultiply(SqlDecimal, SqlDecimal)

The multiplication operator computes the product of the two SqlDecimal parameters.

System_CAPS_pubmethodSystem_CAPS_staticNotEquals(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal parameters to determine whether they are not equal.

System_CAPS_pubmethodSystem_CAPS_staticParse(String)

Converts the String representation of a number to its SqlDecimal equivalent.

System_CAPS_pubmethodSystem_CAPS_staticPower(SqlDecimal, Double)

Raises the value of the specified SqlDecimal structure to the specified exponential power.

System_CAPS_pubmethodSystem_CAPS_staticRound(SqlDecimal, Int32)

Gets the number nearest the specified SqlDecimal structure's value with the specified precision.

System_CAPS_pubmethodSystem_CAPS_staticSign(SqlDecimal)

Gets a value that indicates the sign of a SqlDecimal structure's Value property.

System_CAPS_pubmethodSystem_CAPS_staticSubtract(SqlDecimal, SqlDecimal)

Calculates the results of subtracting the second SqlDecimal operand from the first.

System_CAPS_pubmethodToDouble()

Returns the a double equal to the contents of the Value property of this instance.

System_CAPS_pubmethodToSqlBoolean()

Converts this SqlDecimal structure to SqlBoolean.

System_CAPS_pubmethodToSqlByte()

Converts this SqlDecimal structure to SqlByte.

System_CAPS_pubmethodToSqlDouble()

Converts this SqlDecimal structure to SqlDouble.

System_CAPS_pubmethodToSqlInt16()

Converts this SqlDecimal structure to SqlInt16.

System_CAPS_pubmethodToSqlInt32()

Converts this SqlDecimal structure to SqlInt32.

System_CAPS_pubmethodToSqlInt64()

Converts this SqlDecimal structure to SqlInt64.

System_CAPS_pubmethodToSqlMoney()

Converts this SqlDecimal structure to SqlMoney.

System_CAPS_pubmethodToSqlSingle()

Converts this SqlDecimal structure to SqlSingle.

System_CAPS_pubmethodToSqlString()

Converts this SqlDecimal structure to SqlString.

System_CAPS_pubmethodToString()

Converts this SqlDecimal structure to String.(Overrides ValueType.ToString().)

System_CAPS_pubmethodSystem_CAPS_staticTruncate(SqlDecimal, Int32)

Truncates the specified SqlDecimal structure's value to the that you want position.

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticMaxPrecision

A constant representing the largest possible value for the Precision property.

System_CAPS_pubfieldSystem_CAPS_staticMaxScale

A constant representing the maximum value for the Scale property.

System_CAPS_pubfieldSystem_CAPS_staticMaxValue

A constant representing the maximum value of a SqlDecimal structure.

System_CAPS_pubfieldSystem_CAPS_staticMinValue

A constant representing the minimum value for a SqlDecimal structure.

System_CAPS_pubfieldSystem_CAPS_staticNull

Represents a DBNull that can be assigned to this instance of the SqlDecimalclass.

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticAddition(SqlDecimal, SqlDecimal)

Calculates the sum of the two SqlDecimal operators.

System_CAPS_puboperatorSystem_CAPS_staticDivision(SqlDecimal, SqlDecimal)

The division operator calculates the results of dividing the first SqlDecimal operand by the second.

System_CAPS_puboperatorSystem_CAPS_staticEquality(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal operands to determine whether they are equal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(Double to SqlDecimal)

Converts the Double parameter to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlBoolean to SqlDecimal)

Converts the supplied SqlBoolean structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlDecimal to Decimal)

Converts the SqlDecimal parameter to Decimal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlDouble to SqlDecimal)

Converts the supplied SqlDouble structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlSingle to SqlDecimal)

Converts the supplied SqlSingle structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlString to SqlDecimal)

Converts the supplied SqlString parameter to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticGreaterThan(SqlDecimal, SqlDecimal)

Performs a logical comparison of two SqlDecimal structures to determine whether the first is greater than the second.

System_CAPS_puboperatorSystem_CAPS_staticGreaterThanOrEqual(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is greater than or equal to the second.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(Decimal to SqlDecimal)

Converts the Decimal value to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(Int64 to SqlDecimal)

Converts the supplied Int64 structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(SqlByte to SqlDecimal)

Converts the supplied SqlByte structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(SqlInt16 to SqlDecimal)

Converts the supplied SqlInt16 structure to SqlDecimal

System_CAPS_puboperatorSystem_CAPS_staticImplicit(SqlInt32 to SqlDecimal)

Converts the supplied SqlInt32 structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(SqlInt64 to SqlDecimal)

Converts the supplied SqlInt64 structure to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(SqlMoney to SqlDecimal)

Converts the SqlMoney operand to SqlDecimal.

System_CAPS_puboperatorSystem_CAPS_staticInequality(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal parameters to determine whether they are not equal.

System_CAPS_puboperatorSystem_CAPS_staticLessThan(SqlDecimal, SqlDecimal)

Performs a logical comparison of two SqlDecimal structures to determine whether the first is less than the second.

System_CAPS_puboperatorSystem_CAPS_staticLessThanOrEqual(SqlDecimal, SqlDecimal)

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is less than or equal to the second.

System_CAPS_puboperatorSystem_CAPS_staticMultiply(SqlDecimal, SqlDecimal)

The multiplication operator computes the product of the two SqlDecimal parameters.

System_CAPS_puboperatorSystem_CAPS_staticSubtraction(SqlDecimal, SqlDecimal)

Calculates the results of subtracting the second SqlDecimal operand from the first.

System_CAPS_puboperatorSystem_CAPS_staticUnaryNegation(SqlDecimal)

The unary minus operator negates the SqlDecimal parameter.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIXmlSerializable.GetSchema()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIXmlSerializable.ReadXml(XmlReader)

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIXmlSerializable.WriteXml(XmlWriter)

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

SqlDecimal has different underlying data structures from its corresponding .NET Framework Decimal data type. Decimal has no concept of precision. It uses 3 bytes to store the actual data, and therefore has a maximum scale of 28. The data range is -79,228,162,514,264,337,593,543,950,335 through 79,228,162,514,264,337,593,543,950,335. SqlDecimal has both precision and scale. It uses 4 unsigned 4-byte integers to store the actual data, and therefore has maximum precision and scale of 38. The data range is - 10^38 +1 through 10^38 - 1.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft