G
Gary
The ultimate goal is to have two data grids on a form.
The first Datagrid holds Contact information. The second
grid holds notes for each contact.
When I click on a row for contacts, I would like all
related notes to show on the Notes grid.
I created a data relation using the following code:
----------------------------------------------------------
'lets set up the relationship between the
contacts and notes table
Dim colContacts As DataColumn
Dim colNotes As DataColumn
colContacts = DataSet21.Tables("Contact").Columns
("SysID")
colNotes = DataSet21.Tables("Notes").Columns
("con_id")
Dim order_rel As DataRelation
order_rel = New DataRelation("order_rel",
colContacts, colNotes)
DataSet21.Relations.Add(order_rel)
DG_Notes.SetDataBinding
(DataSet21, "Contact.order_rel")
----------------------------------------------------------
but when I run this code, I get a message saying that "A
relation already exists for the child columns" I tried
to comment out the Relations.Add line but it didn't
work. I then went to the Enterprise manager to see if I
could delete the relation but can't find it.
How can I make the grids work together and not create
duplicate relations?
Any help and "verbose" code examples or changes would
help.
Thanks in advance,
Gary
The first Datagrid holds Contact information. The second
grid holds notes for each contact.
When I click on a row for contacts, I would like all
related notes to show on the Notes grid.
I created a data relation using the following code:
----------------------------------------------------------
'lets set up the relationship between the
contacts and notes table
Dim colContacts As DataColumn
Dim colNotes As DataColumn
colContacts = DataSet21.Tables("Contact").Columns
("SysID")
colNotes = DataSet21.Tables("Notes").Columns
("con_id")
Dim order_rel As DataRelation
order_rel = New DataRelation("order_rel",
colContacts, colNotes)
DataSet21.Relations.Add(order_rel)
DG_Notes.SetDataBinding
(DataSet21, "Contact.order_rel")
----------------------------------------------------------
but when I run this code, I get a message saying that "A
relation already exists for the child columns" I tried
to comment out the Relations.Add line but it didn't
work. I then went to the Enterprise manager to see if I
could delete the relation but can't find it.
How can I make the grids work together and not create
duplicate relations?
Any help and "verbose" code examples or changes would
help.
Thanks in advance,
Gary