RAD Studio for Microsoft .NET |  |

Adding a BDP Reconcile Error dialog to your BDP Application
See Also
Collapse All

You can modify your BDP applications to call the BDP Reconcile Error dialog to handle an update exception (as occurs sometimes when two people are trying to simultaneously update the same row of a database table).

To add a BDP Reconcile Error dialog:

1. Add a BDPDataAdapter component to your existing WinForm.
2. Choose the Events tab on the Object Inspector window
3. Double-click in the content section of the blank pull-down list next to the OnUpdateError event. This will populate the first level of the pull-down list. It will also create the code for the BdpDataAdapter method definition and implementation.
4. Add the lines that are in bold below to the method implementation to handle the event (the following example is using the C# language):

Copy Code

    private void bdpDataAdapter1_OnUpdateError(object sender, Borland.Data.Common.BdpUpdateErrorEventArgs e)
            {
             Borland.Data.Common.ReconcileErrorForm f = new Borland.Data.Provider.ReconcileErrorForm( e );
                f.ShowDialog();
            }

1. Save the changes to your WinForm.

The BDP Reconcile Error dialog will now appear whenever one user is trying to modify data in the same row of a database that another user is working on. The dialog works as follows. As each row in a table is updated

Your new Error Reconcile Form will display four columns in the upper portion of the window, and six radio buttons in the bottom portion of the window. The following table describes each of the columns.

Column Label | Meaning
Column Name | The names of the columns of the table in which an error has occurred.
Current Row | The contents of the row that is currently in contention.
Original Row | What the row contained before the contentious data was entered.
Server Row | The last update that was saved to the Server. (This represents what the row contains on the server.)

The three radio buttons on the lower left portion of the window allow you to indicate how to continue processing after handling the error. You can only choose one option from the following three choices.

Radio Button Label | Meaning
Retry update using primary key | The error will be cleared, and then the update will be attempted again with the primary key. If the data row from the server cannot be found, this option will be disabled.
Skip current row and continue | Choose this option when you have decided not to attempt to update changes for the current row, but you want to try to update the rest of the rows.
Abort updates | The latest updates will not be applied, and error will be cleared, but no more updates will be attempted.

The three radio buttons in the lower right portion of the window allow you to indicate which data to write to the database. You can only choose one option from the following three choices.

Radio Button Label | Meaning
Use original values | Place the data from the Original Row column (described previously) into the row where the contention occurred.
Use server values | Place the data from the Server Row column, (described previously) into the row where the contention occurred.
Use current values | Place the data from the Current Row column, (described previously) into the row where the contention occurred.

See Also

ADO.NET Component Designers

Browsing a Database

Executing SQL in the Data Explorer

Modifying Connections

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!