Author: senga
Date: 2006-03-20 09:18:25 -0500 (Mon, 20 Mar 2006)
New Revision: 58185

Modified:
   trunk/mcs/class/System.Data/System.Data.Common/ChangeLog
   trunk/mcs/class/System.Data/System.Data.Common/DataAdapter.cs
   trunk/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
Log:
2006-03-20  Senganal T <[EMAIL PROTECTED]>

        * System.Data.Common/DataAdapter.cs :
                - Ctor () : Set Default Values for DataAdapter members
        * System.Data.Common/DbDataAdapter.cs : 
                - Update () : Call row.AcceptChanges only if 
AcceptChangesDuringUpdate
                is true. Fixes bug #77776



Modified: trunk/mcs/class/System.Data/System.Data.Common/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Common/ChangeLog    2006-03-20 
14:04:29 UTC (rev 58184)
+++ trunk/mcs/class/System.Data/System.Data.Common/ChangeLog    2006-03-20 
14:18:25 UTC (rev 58185)
@@ -1,3 +1,11 @@
+2006-03-20  Senganal T <[EMAIL PROTECTED]>
+
+       * DataAdapter.cs :
+               - Ctor () : Set Default Values for DataAdapter members
+       * DbDataAdapter.cs : 
+               - Update () : Call row.AcceptChanges only if 
AcceptChangesDuringUpdate
+               is true. Fixes bug #77776
+
 2006-03-09  Senganal T <[EMAIL PROTECTED]>
        
        * Index.cs :

Modified: trunk/mcs/class/System.Data/System.Data.Common/DataAdapter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Common/DataAdapter.cs       
2006-03-20 14:04:29 UTC (rev 58184)
+++ trunk/mcs/class/System.Data/System.Data.Common/DataAdapter.cs       
2006-03-20 14:18:25 UTC (rev 58185)
@@ -71,6 +71,11 @@
                        missingMappingAction = MissingMappingAction.Passthrough;
                        missingSchemaAction = MissingSchemaAction.Add;
                        tableMappings = new DataTableMappingCollection ();
+#if NET_2_0
+                       acceptChangesDuringUpdate = true;
+                       fillLoadOption = LoadOption.OverwriteChanges;
+                       returnProviderSpecificTypes = false;
+#endif 
                }
 
                protected DataAdapter (DataAdapter adapter)
@@ -79,12 +84,15 @@
                        ContinueUpdateOnError = adapter.ContinueUpdateOnError;
                        MissingMappingAction = adapter.MissingMappingAction;
                        MissingSchemaAction = adapter.MissingSchemaAction;
-                       if (adapter.tableMappings == null || 
adapter.TableMappings.Count <= 0) {
-                               return;
-                       }
-                       foreach (ICloneable cloneable in adapter.TableMappings) 
{
-                               TableMappings.Add (cloneable.Clone ());
-                       }
+
+                       if (adapter.tableMappings != null)
+                               foreach (ICloneable cloneable in 
adapter.TableMappings)
+                                       TableMappings.Add (cloneable.Clone ());
+#if NET_2_0
+                       acceptChangesDuringUpdate = 
adapter.AcceptChangesDuringUpdate;
+                       fillLoadOption = adapter.FillLoadOption;
+                       returnProviderSpecificTypes = 
adapter.ReturnProviderSpecificTypes;
+#endif 
                }
 
                #endregion

Modified: trunk/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs     
2006-03-20 14:04:29 UTC (rev 58184)
+++ trunk/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs     
2006-03-20 14:18:25 UTC (rev 58185)
@@ -1090,6 +1090,10 @@
                                        case UpdateStatus.SkipAllRemainingRows:
                                                return updateCount;
                                        }
+#if NET_2_0
+                                       if (!AcceptChangesDuringUpdate)
+                                               continue;
+#endif
                                        row.AcceptChanges ();
                                } catch(Exception e) {
                                        row.RowError = e.Message;

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

Reply via email to