How to: Enable and Disable Hierarchical Update
Hierarchical update is the process of updating modified data in related data tables in a typed dataset by using the new TableAdapterManager. The TableAdapterManager provides the ability to save data in a dataset that uses multiple TableAdapters and still maintain referential integrity in the database. (Referential integrity is the term that is used to describe data that complies with the foreign-key constraints defined in the database.) For more information, see Hierarchical Update Overview.
You can enable and disable Hierarchical Update by setting the Hierarchical Update property of a typed dataset to either True or False. When Hierarchical Update is set to True, the typed-dataset class is generated with a TableAdapterManager component that manages the process of saving changed data in the dataset back to the database. That is, a TableAdapterManager class is generated that controls the order of the Insert, Update, and Delete commands that are executed against the database by the individual TableAdapters. The TableAdapterManager uses the foreign-key relationships in the database to control the order of these commands. For more information, see TableAdapterManager Overview.
When Hierarchical Update is set to False, the typed-dataset class is generated without a TableAdapterManager component. In this scenario, when you save changes back to the database, you must use programmatic logic to determine the order in which to call the individual Insert, Update, and Delete commands without violating the constraints in the database.
By default, new typed datasets have their Hierarchical Update property set to True.
To enable hierarchical update in related tables in a dataset
Open your dataset in the Creating and Editing Typed Datasets and click an empty area on the design surface.
In the Properties window, set the Hierarchical Update property to True.
Save the dataset.
Code is generated with a TableAdapterManager component that automatically performs hierarchical updates.
To disable hierarchical update in related tables in a dataset
Open your dataset in the Dataset Designer and click an empty area on the design surface.
In the Properties window, set the Hierarchical Update property to False.
Save the dataset.
Code is generated without a TableAdapterManager and does not include the logic required to automatically perform hierarchical updates.