Let's say we have a Customer Maintenance form. This form displays information about the customer and the last order placed by the customer. You click a button to "Add" a new order and you are shown the Order Maintenance form with a few textboxes and a DataGrid control. Beside the DataGrid control, you have an "Add" button to add new line items to the order. Clicking Add takes you to the Line Item Maintenance form.

This setup sounds like a typical configuration. If everything is created using DataBound controls and the only "Save" routine is on the Customer Maintenance form, how would you handle this?

You open Customer# 111. You note that there is no Last Order information displayed and click to Add a new order. You enter a little bit of information about the order, then you click to Add a line item. Behind the scenes, you call EndCurrentEdit on the OrderHeader DataTable so that the data is persisted back into the DataSet and the new Identity is available. This new Identity is passed to the Line Item Maintenance form. Now you decide you don't want to save any of this order information and click cancel to get out of the Line Item Maintenance form and cancel to get out of the Order Maintenance form. Now, you look and the Last Order information has data in it relating to the order you just decided not to save.

The problem is that since you have already called EndCurrentEdit on the OrderHeader table and have persisted the data back to the DataSet, how do you revert back to the way it was prior to having clicked on Add?