Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Fill dataset with specific record along with related child records

Posted on 2007-10-16
4
Medium Priority
?
544 Views
Last Modified: 2013-11-26
Hi all,

I have a form onto which I've dragged a datatable from a typed datasource. I've then dragged several child datatables onto the same form so I can now successfully retrieve all records for that dataset.

I then added a query to the parent datatable's tableadapter so that I could search for specific records based on a passed parameter. The parent records are retrieved but the child records are not. I know that I need to write code to fill the child datatables but I don't know how to do this part.

I'm guessing that I need to create additional queries on the other tableadapters that accept parameters for the foreign keys, but how do I write the code that actually fills each of these datatables? Do I use the parent datatable's bindingsource somehow to get it's primary key etc...

Thanks,
Chris
0
Comment
Question by:squeakyloboy
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
RayAtVittoria earned 2000 total points
ID: 20088831
Did you want to display All of the child records for All of the parent records, or display the child records when you have selected one of the parent records?

The first one will be more problematic, but could be done.

Ray
0
 
LVL 2

Expert Comment

by:RayAtVittoria
ID: 20088896
QUOTE: I'm guessing that I need to create additional queries on the other tableadapters that accept parameters for the foreign keys, but how do I write the code that actually fills each of these datatables? Do I use the parent datatable's bindingsource somehow to get it's primary key etc...
 END QUOTE:
You will indeed need to use the parent bindingsource as it gives us the link between parent and child tables. We will see how when you respond to my first question.

I will be away until tomorrow, but I will respond as soon as I can, unless of course someone else has the time sooner..

Cheers
0
 

Author Comment

by:squeakyloboy
ID: 20106988
Hi Ray, thanks for replying. I've actually figure it out but will give you the points anyway for replying.

Thanks again,
Chris
0
 
LVL 2

Expert Comment

by:RayAtVittoria
ID: 20108027
Thanks... I would have liked to help more. Important thing is you got it.

Cheers
Ray
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

564 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