diff options
author | Daniel Morgan <monodanmorg@yahoo.com> | 2005-08-13 03:24:11 +0400 |
---|---|---|
committer | Daniel Morgan <monodanmorg@yahoo.com> | 2005-08-13 03:24:11 +0400 |
commit | 5bc290120dc4a6acc087f41618e627c6ffc0aae7 (patch) | |
tree | 8bda4ecae9e40ce61ce3d0f859772d45f25e99e1 /mcs/class/System.Data/System.Data.SqlClient | |
parent | bc03e9a8f3b2f12f21a6138fd37ab0cfb372923f (diff) |
2005-08-12 Daniel Morgan <danielmorgan@verizon.net>
* SqlCommandBuilder.cs: update command builder based on
OdbcCommandBuilder latest changes to fix regression
of bug 75552
svn path=/trunk/mcs/; revision=48347
Diffstat (limited to 'mcs/class/System.Data/System.Data.SqlClient')
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlClient/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs | 51 |
2 files changed, 18 insertions, 39 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog index 02d699764b4..857f0b09ce4 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog @@ -1,3 +1,9 @@ +2005-08-12 Daniel Morgan <danielmorgan@verizon.net> + + * SqlCommandBuilder.cs: update command builder based on + OdbcCommandBuilder latest changes to fix regression + of bug 75552 + 2005-08-05 Sureshkumar T <tsureshkumar@novell.com> * SqlCommandBuilder.cs: Set SourceVersion property to the created diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs index 4ea95f87870..62e26a15011 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs @@ -553,53 +553,26 @@ namespace System.Data.SqlClient { #region Event Handlers - private void RowUpdatingHandler (object sender, SqlRowUpdatingEventArgs e) + private void RowUpdatingHandler (object sender, SqlRowUpdatingEventArgs args) { - if (e.Status != UpdateStatus.Continue) + if (args.Command != null) return; - - switch (e.StatementType) { - case StatementType.Delete: - deleteCommand = e.Command; - break; - case StatementType.Insert: - insertCommand = e.Command; - break; - case StatementType.Update: - updateCommand = e.Command; - break; - default: - return; - } - try { - BuildCache (false); - - switch (e.StatementType) { - case StatementType.Delete: - e.Command = CreateDeleteCommand (e.Row, e.TableMapping); - e.Status = UpdateStatus.Continue; - break; + switch (args.StatementType) { case StatementType.Insert: - e.Command = CreateInsertCommand (e.Row, e.TableMapping); - e.Status = UpdateStatus.Continue; + args.Command = GetInsertCommand (); break; case StatementType.Update: - e.Command = CreateUpdateCommand (e.Row, e.TableMapping); - e.Status = UpdateStatus.Continue; + args.Command = GetUpdateCommand (); + break; + case StatementType.Delete: + args.Command = GetDeleteCommand (); break; } - - if (e.Command != null && e.Row != null) { - if (e.StatementType != StatementType.Delete) - e.Row.AcceptChanges (); - e.Status = UpdateStatus.Continue; - } - } - catch (Exception exception) { - e.Errors = exception; - e.Status = UpdateStatus.ErrorsOccurred; - } + } catch (Exception e) { + args.Errors = e; + args.Status = UpdateStatus.ErrorsOccurred; + }
} #if NET_2_0 |