setup master-detail tables

R

Rick

VS.NET 2005

I'm not having an intuative experience trying to get the hang of how to
setup a strongly typed master/detail relationshipe between tables.

I have two tables CONTACTS with PK=IDNUM and ORDERS with a field CUSTNUM.

Both tables have CommandStrings like "Select <field list> from TableName..."
(neither has a where clause)

In the visual designer for the xsd file I have set a relationship between
CONTACTS->IDNUM and ORDERS->CUSTNUM.

In a Windows form I have two DataGridView controls, one for each table.

When I run the program, the Orders table never follows the Contact table
when it scrolls.

To me, setting the data relation should have resulted in the child table
filtering its results based on the parent, but obviously not.

What else do I need to do to get the child table to really be a child?

Rick
 
J

James Irvine

Rick said:
VS.NET 2005

I'm not having an intuative experience trying to get the hang of how to
setup a strongly typed master/detail relationshipe between tables.

I have two tables CONTACTS with PK=IDNUM and ORDERS with a field CUSTNUM.

Both tables have CommandStrings like "Select <field list> from
TableName..." (neither has a where clause)

In the visual designer for the xsd file I have set a relationship between
CONTACTS->IDNUM and ORDERS->CUSTNUM.

In a Windows form I have two DataGridView controls, one for each table.

When I run the program, the Orders table never follows the Contact table
when it scrolls.

To me, setting the data relation should have resulted in the child table
filtering its results based on the parent, but obviously not.

What else do I need to do to get the child table to really be a child?

Rick

It sounds like you need to get familiar with the ADO.NET DataRelation
Object. Do a Google search on ".net datarelation" and pick an example.
 
R

Rick

Ok, I got it now.

I was using a DataGridView that I dragged from the main ORDERS table.
Actually I needed to use the ORDERS table that appeared at the bottom of the
CONTACTS table.

Thanks for the hint.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top