Wiki Link: [discussion:485]
Trouble with Delete in multi-table form (video 3) 

Jun 29 2008 at 10:10 PM
I've been following the videos and in video 3, when there are multiple tables on a single form, the video does not explain how to implement DELETE or INSERT functionality. How does this work?

Jul 16 2008 at 12:26 AM
Hi coleifer,

The video uses the Data Source Wizard to automatically create the update, insert and delete statements. If you use the toolbar (BindingNavigator) you can add and delete the parent rows and if you want to delete the child rows, just select the row header and press the delete key. Under the covers the controls are bound to a BindingSource and you can programatically call AddNew or Delete on the parent or child bindingSource to add or remove rows from the DataSet. When you call Update on the tableAdapters later, the UpdateCommand, InsertCommand and DeleteCommand are executed against the databasse. To look at those commands select the TableAdapter in the Dataset designer and look at the properties.

These videos will help explain these concepts better:


Page view tracker