Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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

The SqlDecimal type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSqlDecimal(Decimal)Initializes a new instance of the SqlDecimal structure using the supplied Decimal value.
Public methodSupported by the XNA FrameworkSqlDecimal(Double)Initializes a new instance of the SqlDecimal structure using the supplied double parameter.
Public methodSupported by the XNA FrameworkSqlDecimal(Int32)Initializes a new instance of the SqlDecimal structure using the supplied integer value.
Public methodSupported by the XNA FrameworkSqlDecimal(Int64)Initializes a new instance of the SqlDecimal structure using the supplied long integer value.
Public methodSupported by the XNA FrameworkSqlDecimal(Byte, Byte, Boolean, Int32[])Initializes a new instance of the SqlDecimal structure using the supplied parameters.
Public methodSupported by the XNA FrameworkSqlDecimal(Byte, Byte, Boolean, Int32, Int32, Int32, Int32)Initializes a new instance of the SqlDecimal structure using the supplied parameters.
Top
  NameDescription
Public propertySupported by the XNA FrameworkBinDataGet the binary representation of the value of this SqlDecimal structure as an array of bytes.
Public propertySupported by the XNA FrameworkDataGets the binary representation of this SqlDecimal structure as an array of integers.
Public propertySupported by the XNA FrameworkIsNullIndicates whether this SqlDecimal structure is null.
Public propertySupported by the XNA FrameworkIsPositiveIndicates whether the Value of this SqlDecimal structure is greater than zero.
Public propertySupported by the XNA FrameworkPrecisionGets the maximum number of digits used to represent the Value property.
Public propertySupported by the XNA FrameworkScaleGets the number of decimal places to which Value is resolved.
Public propertySupported by the XNA FrameworkValueGets the value of the SqlDecimal structure. This property is read-only.
Top
  NameDescription
Public methodStatic memberSupported by the XNA FrameworkAbsThe Abs method gets the absolute value of the SqlDecimal parameter.
Public methodStatic memberSupported by the XNA FrameworkAddCalculates the sum of the two SqlDecimal operators.
Public methodStatic memberSupported by the XNA FrameworkAdjustScaleThe 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.
Public methodStatic memberSupported by the XNA FrameworkCeilingReturns the smallest whole number greater than or equal to the specified SqlDecimal structure.
Public methodSupported by the XNA FrameworkCompareTo(Object)Compares this SqlDecimal instance to the supplied Object and returns an indication of their relative values.
Public methodSupported by the XNA FrameworkCompareTo(SqlDecimal)Compares this SqlDecimal instance to the supplied SqlDecimal object and returns an indication of their relative values.
Public methodStatic memberSupported by the XNA FrameworkConvertToPrecScaleAdjusts the value of the SqlDecimal operand to the indicated precision and scale.
Public methodStatic memberSupported by the XNA FrameworkDivideThe division operator calculates the results of dividing the first SqlDecimal operand by the second.
Public methodSupported by the XNA FrameworkEquals(Object)Compares the supplied Object parameter to the Value property of the SqlDecimal instance. (Overrides ValueType.Equals(Object).)
Public methodStatic memberSupported by the XNA FrameworkEquals(SqlDecimal, SqlDecimal)Performs a logical comparison of the two SqlDecimal operands to determine whether they are equal.
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberSupported by the XNA FrameworkFloorRounds a specified SqlDecimal number to the next lower whole number.
Public methodSupported by the XNA FrameworkGetHashCodeReturns the hash code for this instance. (Overrides ValueType.GetHashCode().)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberSupported by the XNA FrameworkGetXsdTypeReturns the XML Schema definition language (XSD) of the specified XmlSchemaSet.
Public methodStatic memberSupported by the XNA FrameworkGreaterThanPerforms a logical comparison of two SqlDecimal structures to determine whether the first is greater than the second.
Public methodStatic memberSupported by the XNA FrameworkGreaterThanOrEqualPerforms a logical comparison of the two SqlDecimal parameters to determine whether the first is greater than or equal to the second.
Public methodStatic memberSupported by the XNA FrameworkLessThanPerforms a logical comparison of two SqlDecimal structures to determine whether the first is less than the second.
Public methodStatic memberSupported by the XNA FrameworkLessThanOrEqualPerforms a logical comparison of the two SqlDecimal parameters to determine whether the first is less than or equal to the second.
Protected methodSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberSupported by the XNA FrameworkMultiplyThe multiplication operator computes the product of the two SqlDecimal parameters.
Public methodStatic memberSupported by the XNA FrameworkNotEqualsPerforms a logical comparison of the two SqlDecimal parameters to determine whether they are not equal.
Public methodStatic memberSupported by the XNA FrameworkParseConverts the String representation of a number to its SqlDecimal equivalent.
Public methodStatic memberSupported by the XNA FrameworkPowerRaises the value of the specified SqlDecimal structure to the specified exponential power.
Public methodStatic memberSupported by the XNA FrameworkRoundGets the number nearest the specified SqlDecimal structure's value with the specified precision.
Public methodStatic memberSupported by the XNA FrameworkSignGets a value that indicates the sign of a SqlDecimal structure's Value property.
Public methodStatic memberSupported by the XNA FrameworkSubtractCalculates the results of subtracting the second SqlDecimal operand from the first.
Public methodSupported by the XNA FrameworkToDoubleReturns the a double equal to the contents of the Value property of this instance.
Public methodSupported by the XNA FrameworkToSqlBooleanConverts this SqlDecimal structure to SqlBoolean.
Public methodSupported by the XNA FrameworkToSqlByteConverts this SqlDecimal structure to SqlByte.
Public methodSupported by the XNA FrameworkToSqlDoubleConverts this SqlDecimal structure to SqlDouble.
Public methodSupported by the XNA FrameworkToSqlInt16Converts this SqlDecimal structure to SqlInt16.
Public methodSupported by the XNA FrameworkToSqlInt32Converts this SqlDecimal structure to SqlInt32.
Public methodSupported by the XNA FrameworkToSqlInt64Converts this SqlDecimal structure to SqlInt64.
Public methodSupported by the XNA FrameworkToSqlMoneyConverts this SqlDecimal structure to SqlMoney.
Public methodSupported by the XNA FrameworkToSqlSingleConverts this SqlDecimal structure to SqlSingle.
Public methodSupported by the XNA FrameworkToSqlStringConverts this SqlDecimal structure to SqlString.
Public methodSupported by the XNA FrameworkToStringConverts this SqlDecimal structure to String. (Overrides ValueType.ToString().)
Public methodStatic memberSupported by the XNA FrameworkTruncateTruncates the specified SqlDecimal structure's value to the that you want position.
Top
  NameDescription
Public operatorStatic memberSupported by the XNA FrameworkAdditionCalculates the sum of the two SqlDecimal operators.
Public operatorStatic memberSupported by the XNA FrameworkDivisionThe division operator calculates the results of dividing the first SqlDecimal operand by the second.
Public operatorStatic memberSupported by the XNA FrameworkEqualityPerforms a logical comparison of the two SqlDecimal operands to determine whether they are equal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(Double to SqlDecimal)Converts the Double parameter to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlBoolean to SqlDecimal)Converts the supplied SqlBoolean structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlDecimal to Decimal)Converts the SqlDecimal parameter to Decimal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlDouble to SqlDecimal)Converts the supplied SqlDouble structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlSingle to SqlDecimal)Converts the supplied SqlSingle structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlString to SqlDecimal)Converts the supplied SqlString parameter to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkGreaterThanPerforms a logical comparison of two SqlDecimal structures to determine whether the first is greater than the second.
Public operatorStatic memberSupported by the XNA FrameworkGreaterThanOrEqualPerforms a logical comparison of the two SqlDecimal parameters to determine whether the first is greater than or equal to the second.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(Decimal to SqlDecimal)Converts the Decimal value to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(Int64 to SqlDecimal)Converts the supplied Int64 structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(SqlByte to SqlDecimal)Converts the supplied SqlByte structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(SqlInt16 to SqlDecimal)Converts the supplied SqlInt16 structure to SqlDecimal
Public operatorStatic memberSupported by the XNA FrameworkImplicit(SqlInt32 to SqlDecimal)Converts the supplied SqlInt32 structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(SqlInt64 to SqlDecimal)Converts the supplied SqlInt64 structure to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(SqlMoney to SqlDecimal)Converts the SqlMoney operand to SqlDecimal.
Public operatorStatic memberSupported by the XNA FrameworkInequalityPerforms a logical comparison of the two SqlDecimal parameters to determine whether they are not equal.
Public operatorStatic memberSupported by the XNA FrameworkLessThanPerforms a logical comparison of two SqlDecimal structures to determine whether the first is less than the second.
Public operatorStatic memberSupported by the XNA FrameworkLessThanOrEqualPerforms a logical comparison of the two SqlDecimal parameters to determine whether the first is less than or equal to the second.
Public operatorStatic memberSupported by the XNA FrameworkMultiplyThe multiplication operator computes the product of the two SqlDecimal parameters.
Public operatorStatic memberSupported by the XNA FrameworkSubtractionCalculates the results of subtracting the second SqlDecimal operand from the first.
Public operatorStatic memberSupported by the XNA FrameworkUnaryNegationThe unary minus operator negates the SqlDecimal parameter.
Top
  NameDescription
Public fieldStatic memberSupported by the XNA FrameworkMaxPrecisionA constant representing the largest possible value for the Precision property.
Public fieldStatic memberSupported by the XNA FrameworkMaxScaleA constant representing the maximum value for the Scale property.
Public fieldStatic memberSupported by the XNA FrameworkMaxValueA constant representing the maximum value of a SqlDecimal structure.
Public fieldStatic memberSupported by the XNA FrameworkMinValueA constant representing the minimum value for a SqlDecimal structure.
Public fieldStatic memberSupported by the XNA FrameworkNullRepresents a DBNull that can be assigned to this instance of the SqlDecimalclass.
Top
  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable.GetSchemaThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable.ReadXmlThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable.WriteXmlThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Top

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

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.