diff options
author | Sureshkumar T <suresh@mono-cvs.ximian.com> | 2005-03-11 08:06:51 +0300 |
---|---|---|
committer | Sureshkumar T <suresh@mono-cvs.ximian.com> | 2005-03-11 08:06:51 +0300 |
commit | a972c04380e82e5b16fc54056dd7fc85e4d304a6 (patch) | |
tree | fe28553e788af1385a9b7b35e8cb9d0231670717 /mcs/class/System.Data/System.Data.SqlTypes | |
parent | 3209c61c7e498866e799d4cae7902f700f337b18 (diff) |
(Parse): Re-org. Resolve unreachable code.
svn path=/trunk/mcs/; revision=41673
Diffstat (limited to 'mcs/class/System.Data/System.Data.SqlTypes')
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlTypes/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog b/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog index 3df7fec703b..32b467e01d5 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog @@ -1,3 +1,7 @@ +2005-03-11 Sureshkumar T <tsureshkumar@novell.com> + + * SqlDateTime.cs (Parse): Re-org. Resolve unreachable code. + 2005-02-11 Sureshkumar T <tsureshkumar@novell.com> Ankit Jain <radical@corewars.org> diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs index 62802dbe4d0..eb224a44ce2 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs +++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs @@ -243,12 +243,17 @@ namespace System.Data.SqlTypes 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 () |