Author: suresh
Date: 2005-03-11 00:06:51 -0500 (Fri, 11 Mar 2005)
New Revision: 41673

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
Log:
(Parse): Re-org. Resolve unreachable code.


Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog  2005-03-11 
01:17:37 UTC (rev 41672)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog  2005-03-11 
05:06:51 UTC (rev 41673)
@@ -1,3 +1,7 @@
+2005-03-11  Sureshkumar T  <[EMAIL PROTECTED]>
+
+       * SqlDateTime.cs (Parse): Re-org. Resolve unreachable code.
+
 2005-02-11  Sureshkumar T  <[EMAIL PROTECTED]>
            Ankit Jain     <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs     
2005-03-11 01:17:37 UTC (rev 41672)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs     
2005-03-11 05:06:51 UTC (rev 41673)
@@ -243,12 +243,17 @@
                         DateTimeFormatInfo fmtInfo = 
DateTimeFormatInfo.CurrentInfo;
                         try {
                                 return new SqlDateTime (DateTime.Parse (s, 
fmtInfo));
-                        } catch (Exception e) {
-                                // try parsing in invariant culture
+                        } catch (Exception) { }
+
+                        // try parsing in invariant culture
+                        try {
                                 return new SqlDateTime (DateTime.Parse (s, 
CultureInfo.InvariantCulture));
-                        }
+                        } catch (Exception) { }
+
+                        // Not a recognizable format.
                         throw new FormatException (String.Format ("String {0} 
is not recognized as "+
                                                                   " valid 
DateTime.", s));
+
                }
 
                public SqlString ToSqlString ()

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

Reply via email to