Fixed bug 78509 in OracleParameter (trimming trailing spaces) and added regression...
[mono.git] / mcs / class / System.Data.OracleClient / System.Data.OracleClient / OracleCommand.cs
index 1bbc3bcd97c5621bc151459ef3716a62033ff94d..56f08fa8827966b6a74318a2fa470d8a6b981adf 100644 (file)
@@ -130,9 +130,8 @@ namespace System.Data.OracleClient {
                [DefaultValue (null)]
                IDbConnection IDbCommand.Connection {
                        get { return Connection; }
-                       set { 
-                               if (!(value is OracleConnection))
-                                       throw new InvalidCastException ("The value was not a valid OracleConnection.");
+                       set {
+                                // InvalidCastException is expected when types do not match
                                Connection = (OracleConnection) value;
                        }
                }
@@ -143,9 +142,8 @@ namespace System.Data.OracleClient {
 
                IDbTransaction IDbCommand.Transaction {
                        get { return Transaction; }
-                       set { 
-                               if (!(value is OracleTransaction))
-                                       throw new ArgumentException ();
+                       set {
+                                // InvalidCastException is expected when types do not match
                                Transaction = (OracleTransaction) value; 
                        }
                }