For more information on saving data from a single data table back to a database, see When updating related tables in a dataset, it is important to update in the proper sequence to reduce the chance of violating referential integrity constraints.
The order of command execution will also follow the indices of the .
Fill(category Table) Dim category Row As Data Row = category Table.
Original Dim category Table As New Data Table adapter.
If you aren't using data binding, and are saving changes for related tables, you have to manually instantiate a variable of the auto-generated Table Adapter Manager class, and then call its Udpate All method.
Each Data Row object has a Row State property that you can examine to determine the current state of the row.
Tables["Categories"]; Data Row del Rows = cat Table.
Write Line("Deleted rows:\n"); foreach (Data Column cat Col in cat Table.
When saving data in related tables, Visual Studio provides a Table Adapter Manager component that assists in performing saves in the proper order based on the foreign-key constraints defined in the database.
For more information, see method of a Table Adapter or data adapter, passing the name of the data table that contains the values to be written to the database.