Author: krasnov
Date: 2007-02-11 08:25:17 -0500 (Sun, 11 Feb 2007)
New Revision: 72611

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
Log:
* SqlDateTime.cs: changed MaxValue and MinValue initialization, it was failing 
on .net VM.

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog  2007-02-11 
09:51:28 UTC (rev 72610)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog  2007-02-11 
13:25:17 UTC (rev 72611)
@@ -1,3 +1,8 @@
+2007-02-11  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * SqlDateTime.cs: changed MaxValue and MinValue initialization, it was
+       failing on .net VM.
+
 2007-02-09  Nagappan A  <[EMAIL PROTECTED]>
 
        * SqlNotFilledException.cs: Removed APIs that are not part of both

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs     
2007-02-11 09:51:28 UTC (rev 72610)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs     
2007-02-11 13:25:17 UTC (rev 72611)
@@ -52,8 +52,8 @@
                private DateTime value;
                private bool notNull;
 
-               public static readonly SqlDateTime MaxValue = new SqlDateTime 
(9999,12,31,23,59,59, (double)997);
-               public static readonly SqlDateTime MinValue = new SqlDateTime 
(1753,1,1);
+               public static readonly SqlDateTime MaxValue;
+               public static readonly SqlDateTime MinValue;
                public static readonly SqlDateTime Null;
                public static readonly int SQLTicksPerHour = 1080000;
                public static readonly int SQLTicksPerMinute = 18000;
@@ -63,6 +63,17 @@
 
                #region Constructors
 
+               static SqlDateTime ()
+               {
+                       DateTime t = new DateTime (9999, 12, 31, 23, 59, 59);
+                       long ticks = (long) (t.Ticks + (997 * 10000));
+                       MaxValue.value = new DateTime (ticks);
+                       MaxValue.notNull = true;
+
+                       MinValue.value = new DateTime (1753, 1, 1);
+                       MinValue.notNull = true;
+               }
+
                public SqlDateTime (DateTime value) 
                {
                        this.value = value;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to