Browse Source

2003-01-26 Gonzalo Paniagua Javier <[email protected]>

	* DbEnumerator.cs: why does the runtime throw an invalid cast here? The
	object is an Int16... Gotta fill a bug report and when fixed undo this
	patch.

svn path=/trunk/mcs/; revision=10914
Gonzalo Paniagua Javier 23 years ago
parent
commit
72ebbb608f

+ 6 - 0
mcs/class/System.Data/System.Data.Common/ChangeLog

@@ -1,3 +1,9 @@
+2003-01-26  Gonzalo Paniagua Javier <[email protected]>
+
+	* DbEnumerator.cs: why does the runtime throw an invalid cast here? The
+	object is an Int16... Gotta fill a bug report and when fixed undo this
+	patch.
+
 2003-01-08  Gonzalo Paniagua Javier <[email protected]>
 
 	* DbDataRecord.cs: return DbNull.Value in GetValue () if value is null.

+ 4 - 4
mcs/class/System.Data/System.Data.Common/DbEnumerator.cs

@@ -76,14 +76,14 @@ namespace System.Data.Common {
 				columnSchema.TableName = row ["BaseTableName"].ToString ();
 
 				if (row ["NumericPrecision"] != DBNull.Value)
-					columnSchema.NumericPrecision = (byte) row ["NumericPrecision"];
+					columnSchema.NumericPrecision = Convert.ToByte (row ["NumericPrecision"]);
 				else
-					columnSchema.NumericPrecision = (byte) 0;
+					columnSchema.NumericPrecision = Convert.ToByte (0);
 
 				if (row ["NumericScale"] != DBNull.Value)
-					columnSchema.NumericScale = (byte) row ["NumericScale"];
+					columnSchema.NumericScale = Convert.ToByte (row ["NumericScale"]);
 				else
-					columnSchema.NumericScale = (byte) 0;
+					columnSchema.NumericScale = Convert.ToByte (0);
 
 				schema [index] = columnSchema;
 				index += 1;