updating multiple tables using ADO.NET 2 (VB)
Posted on 2006-11-17
I'm writing an application using ADO.NET 2 and I'm fine getting and updating data from one table, but I'm confused about updating multiple related tables.
I've got a parent table that has 2 child tables, say a customer table that has two child tables phoneNumbers and deliveryaddresses.
I need to retrieve a customer with a particular id, and all its child tables. These will then be updated in one transaction.
What is the best way to do this?
- do I need one dataadapter per table? (I've tried using only one adapter, but can't get updates to work)
- should I get the tables into one dataset or separate datasets?
(I've got 2 ado.net books and 1 vb.net book and none of them describe this scenario - any suggestions for a good reference book?)