Part III XML and Data Access

This application executes a couple of SQL commands to obtain a DataSet object filled with two tables—Employees and Territories. The names of the DataSet object and the in-memory tables can be changed at will using text boxes. Next the application creates a relation between the tables, sets the nesting property to true, and creates the DiffGram. The DiffGram is created using an in-memory string writer, and the output text is written to a multiline, read-only text box. Clicking the Edit button opens a new form with a DataGrid control for editing rows. The DataGrid control is bound to the DataSet object generated by the query, and is shown in Figure 10-4.

Figure 10-4 At the end of the editing phase, the updated DataSet object is resaved as a DiffGram and the pending changes are displayed.
F10UN04

The child form allows you to set errors and enter any type of changes. When the form is dismissed, the main application automatically saves the bound