Author: kostat
Date: 2007-02-28 09:08:36 -0500 (Wed, 28 Feb 2007)
New Revision: 73548

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs
Log:
convert value only if it's convertable

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs       
2007-02-28 14:05:16 UTC (rev 73547)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs       
2007-02-28 14:08:36 UTC (rev 73548)
@@ -223,7 +223,7 @@
                                return value;
                        }
                        // .NET throws an exception to the user.
-                       object convertedValue = 
Convert.ChangeType(value,SqlConvert.SqlDbTypeToValueType(SqlDbType));
+                       object convertedValue = value is IConvertible ? 
Convert.ChangeType(value,SqlConvert.SqlDbTypeToValueType(SqlDbType)) : value;
                        return convertedValue;
                }
 

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

Reply via email to