Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

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.

NoteNote:

By default, new typed datasets created in Visual Studio 2008 have their Hierarchical Update property set to True, whereas typed datasets created in earlier versions of Visual Studio have their Hierarchical Update property set to False.

To enable hierarchical update in related tables in a dataset

  1. Open your dataset in the Dataset Designer and click an empty area on the design surface.

  2. In the Properties window, set the Hierarchical Update property to True.

  3. 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

  1. Open your dataset in the Dataset Designer and click an empty area on the design surface.

  2. In the Properties window, set the Hierarchical Update property to False.

  3. Save the dataset.

    Code is generated without a TableAdapterManager and does not include the logic required to automatically perform hierarchical updates.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft