Author: anagappan
Date: 2006-09-26 07:11:17 -0400 (Tue, 26 Sep 2006)
New Revision: 65911

Modified:
   trunk/mcs/class/System.Data/System.Data/ChangeLog
   trunk/mcs/class/System.Data/System.Data/DataTable.cs
Log:
* DataTable.cs (RowsExist): Check rows based on version.



Modified: trunk/mcs/class/System.Data/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data/ChangeLog   2006-09-26 10:26:28 UTC 
(rev 65910)
+++ trunk/mcs/class/System.Data/System.Data/ChangeLog   2006-09-26 11:11:17 UTC 
(rev 65911)
@@ -1,5 +1,7 @@
 2006-09-26  Nagappan A  <[EMAIL PROTECTED]>
 
+       * DataTable.cs (RowsExist): Check rows based on version.
+
        * DataRow.cs: Raise exception same as MS.NET. Thanks to
        Hubert FONGARNAND <[EMAIL PROTECTED]> for
        providing this patch.

Modified: trunk/mcs/class/System.Data/System.Data/DataTable.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data/DataTable.cs        2006-09-26 
10:26:28 UTC (rev 65910)
+++ trunk/mcs/class/System.Data/System.Data/DataTable.cs        2006-09-26 
11:11:17 UTC (rev 65911)
@@ -697,7 +697,11 @@
                                        if (thisRow.RowState != 
DataRowState.Deleted) {
                                                bool match = true;
                                                // check if the values in the 
columns are equal
-                                               int thisIndex = 
thisRow.IndexFromVersion(DataRowVersion.Current);
+                                               int thisIndex = -1;
+                                               if (thisRow.RowState == 
DataRowState.Modified)
+                                                       thisIndex = 
thisRow.IndexFromVersion(DataRowVersion.Original);
+                                               else
+                                                       thisIndex = 
thisRow.IndexFromVersion(DataRowVersion.Current);
                                                foreach (DataColumn column in 
columns) {
                                                        if 
(column.DataContainer.CompareValues(thisIndex, index) != 0) {
                                                                match = false;

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

Reply via email to