2004-09-28 Umadevi S <sumadevi@novell.com>
authorUmadevi S <uma@mono-cvs.ximian.com>
Tue, 28 Sep 2004 04:17:39 +0000 (04:17 -0000)
committerUmadevi S <uma@mono-cvs.ximian.com>
Tue, 28 Sep 2004 04:17:39 +0000 (04:17 -0000)
        * DataRow.cs - checked for Enforceconstraints, while using indices to search for related rows

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

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

index 73fabf0de63f2cc14e8bd339aaf6916709f93019..cca7ae3aec1388b009a4292bef76f3d30ca16471 100644 (file)
@@ -1,3 +1,6 @@
+2004-09-28 Umadevi S <sumadevi@novell.com>
+       * DataRow.cs - checked for Enforceconstraints, while using indices to search for related rows
+
 2004-09-24  Sureshkumar T  <tsureshkumar@novell.com>
 
        * DataSet.cs : Don't check constraints for dataset clear
index 830f765e2a08bd8dfcb72633ce314c4aa5369474..dca7e83a39bb88761e0a4bb29a0dd6b5de792636 100644 (file)
@@ -1037,7 +1037,9 @@ namespace System.Data {
                        int numColumn = parentColumns.Length;
                        if (HasVersion(version)) {
                                Index indx = relation.ParentTable.GetIndexByColumns (parentColumns);
-                               if (indx != null) { // get the child rows from the index
+                               if (indx != null && 
+    (Table == null || Table.DataSet == null || 
+     Table.DataSet.EnforceConstraints)) { // get the child rows from the index
                                        Node[] childNodes = indx.FindAllSimple(childColumns, IndexFromVersion(version));
                                        for (int i = 0; i < childNodes.Length; i++) {
                                                rows.Add (childNodes[i].Row);
@@ -1046,7 +1048,6 @@ namespace System.Data {
                                else { // no index so we have to search manualy.
                                        int curIndex = IndexFromVersion(DataRowVersion.Current);
                                        int tmpRecord = relation.ParentTable.RecordCache.NewRecord();
-
                                        try {
                                                for (int i = 0; i < numColumn; i++) {
                                                        // according to MSDN: the DataType value for both columns must be identical.