O'Reilly logo

ADO.NET in a Nutshell by Bill Hamilton, Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

SqlDecimal

Synopsis

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  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required