SqlDecimalExtensions.cs 368 B

123456789101112131415161718
  1. using System.Data.SqlTypes;
  2. using Mono.Data.Tds.Protocol;
  3. namespace System.Data.SqlClient
  4. {
  5. static class SqlDecimalExtensions
  6. {
  7. public static readonly SqlDecimal Null;
  8. internal static SqlDecimal FromTdsBigDecimal (TdsBigDecimal x)
  9. {
  10. if (x == null)
  11. return Null;
  12. else
  13. return new SqlDecimal (x.Precision, x.Scale, !x.IsNegative, x.Data);
  14. }
  15. }
  16. }