?
Solved

updating multiple tables using ADO.NET 2 (VB)

Posted on 2006-11-17
4
Medium Priority
?
150 Views
Last Modified: 2007-12-19
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?)

0
Comment
Question by:darrenwright
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 14

Expert Comment

by:jake072
ID: 17965460
What database are you trying to modify (SQL, Access ??)

Jake
0
 

Author Comment

by:darrenwright
ID: 17965554
SQL 2005

0
 
LVL 6

Accepted Solution

by:
riyazthad earned 750 total points
ID: 17966140
- do I need one dataadapter per table? (I've tried using only one adapter, but can't get updates to work)

No You cannot update multiple table with sqlCommandBuilder.

Better approach , I thinik, have mulitple sqlCommnad Object for each update. And fire action query using sqlCommand.ExecuteNonQuery
0
 

Author Comment

by:darrenwright
ID: 18052469
I've implemented this by having a separate dataAdapter per table.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question