2005-02-02 Sureshkumar T <tsureshkumar@novell.com>
authorSureshkumar T <suresh@mono-cvs.ximian.com>
Wed, 2 Feb 2005 11:42:13 +0000 (11:42 -0000)
committerSureshkumar T <suresh@mono-cvs.ximian.com>
Wed, 2 Feb 2005 11:42:13 +0000 (11:42 -0000)
* ForeignKeyConstraint.cs: validating columns: move checking
"tables are of same dataset" before "checking column types".

fixes nunit failure: ForeignKeyConstraint.CtorExceptions.

svn path=/trunk/mcs/; revision=39978

mcs/class/System.Data/System.Data/ChangeLog
mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs

index 9429e03a5522b5a45e3b6d4c956a0d1d4de83d71..1e8830daec63c2f94b88345cfda0a66641e793f3 100644 (file)
@@ -1,3 +1,10 @@
+2005-02-02  Sureshkumar T  <tsureshkumar@novell.com>
+
+       * ForeignKeyConstraint.cs: validating columns: move checking
+       "tables are of same dataset" before "checking column types".
+
+       fixes nunit failure: ForeignKeyConstraint.CtorExceptions.
+       
 2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
 
        * DataViewManager.cs : let's just use StringWriter instead of 
index 3e03e3ff0655e887c80295f1cd05fc471b1bd3d7..2090b383374a57b0ba67eed4a1b0c80bfa1f329e 100644 (file)
@@ -228,6 +228,17 @@ namespace System.Data {
                                
                        }
 
+                        //Same dataset.  If both are null it's ok
+                       if (ptable.DataSet != ctable.DataSet)
+                       {
+                               //LAMESPEC: spec says InvalidConstraintExceptoin
+                               //      impl does InvalidOperationException
+                               throw new InvalidOperationException("Parent column and child column must belong to" + 
+                                               " tables that belong to the same DataSet.");
+                                               
+                       }       
+
+
                        for (int i = 0; i < parentColumns.Length; i++)
                        {
                                DataColumn pc = parentColumns[i];
@@ -247,15 +258,6 @@ namespace System.Data {
                                        
                        }
                        
-                       //Same dataset.  If both are null it's ok
-                       if (ptable.DataSet != ctable.DataSet)
-                       {
-                               //LAMESPEC: spec says InvalidConstraintExceptoin
-                               //      impl does InvalidOperationException
-                               throw new InvalidOperationException("Parent column and child column must belong to" + 
-                                               " tables that belong to the same DataSet.");
-                                               
-                       }       
                }