vs2005 - Parent-Child dataGridViews with tableAdapters

D

dbuchanan

Hello,

How do I create a Parent-Child relationship between two DataGridView in
a form using TableAdapters. The two tables already have a relationship
defined in the dataset.

What event do I use to update the child dgv? The RowEnter event?

Thank you,
dbuchanan
 
B

Bajoo

after you have created DataSet in VS2005 and if you Database has the
parent Child relationship then you will be able to see the child Table
under the Parent table(like a field) in the datasource of VS. Change
both(parent and child) view to DataGridView and drag both to the form.
make sure that you drag-drop the child table which is displayed as a
field of the parent.
Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/
 
D

dbuchanan

Hello Bajoo,

And there the mystery;

My solution has two projects. One is 'QmsDataLayer' and the other is
'QmsUserInterface'.

When I am in 'QmsDataLayer' were the dataset is located and I go to the
"DataSouce" window I can see the child table under the parent table
(like a field) just as you describe.
[-] DataSet1
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] Table2
[+] Table2


However, When I am in 'QmsUserInterface' where the dataset is
referenced, and I go the the "DataSource" window it looks different;
[-] {} QmsDataLayer
[+] DataSet1
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] DataSet1.Table2

I don't see any child tables (like a field) under the parent table.

I can't believe that vs2005 doesn't allow relationships when the
dataset is reference, so how do I get the relatiohship for a referenced
dataset? And how do I link a child datagridview to a parent datagrid
view?

Thank you,
dbuchanan
 
D

dbuchanan

Bajoo,

Wait, I didn't look close enough. It *is* there;
[-] {} QmsDataLayer
[-] DataSet1
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] Table2
[+] Table2
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] DataSet1.Table2

Now I'll try to follow your suggestion

Thank you,
dbuchanan
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top