System.Data.SqlTypes (system.data.dll) |
struct |
A structure that represents a numeric value with a fixed precision
and scale and a value between -1038-1 and
1038-1. You can set the precision through
the Precision property (which represents the
maximum number of digits used), and the scale through the
Scale property (which represents the number of
decimal places to which the value is resolved).
public struct SqlDecimal : INullable, IComparable {
// Public Constructors
public SqlDecimal(byte bPrecision, byte bScale, bool fPositive, int[ ] bits);
public SqlDecimal(byte bPrecision, byte bScale, bool fPositive, int data1, int data2, int data3, int data4);
public SqlDecimal( decimal value);
public SqlDecimal( double dVal);
public SqlDecimal( int value);
public SqlDecimal( long value);
// Public Static Fields
public static readonly byte MaxPrecision; // =38
public static readonly byte MaxScale; // =38
public static readonly SqlDecimal MaxValue; // =99999999999999999999999999999999999999
public static readonly SqlDecimal MinValue; // =-99999999999999999999999999999999999999
public static readonly SqlDecimal Null; // =Null
// Public Instance Properties
public byte[ ] BinData{get; }
public int[ ] Data{get; }
public bool IsNull{get; } // implements INullable
public bool IsPositive{get; }
public byte Precision{get; }
public byte Scale{get; }
public decimal Value{get; }
// Public Static Methods
public static SqlDecimal Abs( SqlDecimal n);
public static SqlDecimal Add( SqlDecimal x, SqlDecimal y);
public static SqlDecimal AdjustScale(SqlDecimal n, int digits, bool fRound);
public static SqlDecimal Ceiling( SqlDecimal n);
public static SqlDecimal ConvertToPrecScale(SqlDecimal n, int precision, int scale);
public static SqlDecimal Divide(SqlDecimal x, SqlDecimal y);
public static SqlBoolean Equals(SqlDecimal x, SqlDecimal y);
public static SqlDecimal Floor( SqlDecimal n);
public static SqlBoolean GreaterThan(SqlDecimal x, SqlDecimal y);
public static SqlBoolean GreaterThanOrEqual(SqlDecimal x, SqlDecimal y);
public static SqlBoolean LessThan(SqlDecimal x, SqlDecimal y);
public static SqlBoolean LessThanOrEqual(SqlDecimal x, SqlDecimal y);
public static SqlDecimal Multiply(SqlDecimal x, SqlDecimal y);
public static SqlBoolean NotEquals(SqlDecimal x, SqlDecimal y);
public static SqlDecimal Parse( string s);
public static SqlDecimal Power( SqlDecimal n, double exp);
public static SqlDecimal Round(SqlDecimal n, int position);
public static SqlInt32 Sign( SqlDecimal n);
public static SqlDecimal Subtract(SqlDecimal x, SqlDecimal y);
public static SqlDecimal Truncate(SqlDecimal n, int position);
public static SqlDecimal operator *(SqlDecimal x, SqlDecimal y);
public static SqlDecimal operator /(SqlDecimal x, SqlDecimal y);
public static SqlDecimal operator -( SqlDecimal x);
public static SqlDecimal operator -(SqlDecimal x, SqlDecimal y);
public static SqlDecimal operator +(SqlDecimal x, SqlDecimal y);
public static SqlBoolean operator !=(SqlDecimal x, SqlDecimal y);
public static SqlBoolean operator <(SqlDecimal x, SqlDecimal y);
public static SqlBoolean operator <=(SqlDecimal x, SqlDecimal y);
public static SqlBoolean operator ==(SqlDecimal x, SqlDecimal y);
public static SqlBoolean operator >(SqlDecimal x, SqlDecimal y);
public static SqlBoolean operator >=(SqlDecimal x, SqlDecimal y);
public static explicit operator decimal( SqlDecimal x);
public static explicit operator SqlDecimal( SqlBoolean x);
public static explicit operator SqlDecimal( SqlDouble x);
public static explicit operator SqlDecimal( SqlSingle x);
public static explicit operator SqlDecimal( SqlString x);
public static implicit operator SqlDecimal( decimal x);
public static implicit operator SqlDecimal( SqlByte x);
public static implicit operator SqlDecimal( SqlInt16 x);
public static implicit operator SqlDecimal( SqlInt32 x);
public static implicit operator SqlDecimal( SqlInt64 x);
public static implicit operator SqlDecimal( SqlMoney x);
// Public Instance Methods
public int CompareTo( object value); // implements IComparable
public override bool Equals( object value); // overrides ValueType
public override int GetHashCode( ); // overrides ValueType
public double ToDouble( );
public SqlBoolean ToSqlBoolean( );
public SqlByte ToSqlByte( );
public SqlDouble ToSqlDouble( );
public SqlInt16 ToSqlInt16( );
public SqlInt32 ToSqlInt32( );
public SqlInt64 ToSqlInt64( );
public SqlMoney ToSqlMoney( );
public SqlSingle ToSqlSingle( );
public SqlString ToSqlString( );
public override string ToString( ); // overrides ValueType
}
Hierarchy
System.Object
System.ValueType SqlDecimal(INullable, System.IComparable)
Returned By
System.Data.SqlClient.SqlDataReader.GetSqlDecimal( )
, SqlBoolean.ToSqlDecimal( )
, SqlByte.ToSqlDecimal( )
, SqlDouble.ToSqlDecimal( )
, SqlInt16.ToSqlDecimal( )
, SqlInt32.ToSqlDecimal( )
, SqlInt64.ToSqlDecimal( )
, SqlMoney.ToSqlDecimal( )
, SqlSingle.ToSqlDecimal( )
, SqlString.ToSqlDecimal( )
|