Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

updating multiple tables using ADO.NET 2 (VB)

Posted on 2006-11-17
4
Medium Priority
?
151 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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