To the forum,
I am new to VB.net and database programing in general and have a question regarding the datagrid and databinding.
I have three tables with the following columns:
tblContacts:
- idContact
- FirstName
- Surname
tblContactNumbers:
- idContactNumber
- idContact
- idNumberType
- ContactNumber
tblNumberType:
- idNumberType
- NumberType
I have then set up relations between my two tables where:
- tblContacts.idContact to tblContactNumbers.idContact [one-many]
- tblNumberType.idNumberType to tblContactNumbers.idContact [one-many]
I have bound tblContacts to Datagrid 1.
When I select a record [contact] in Datagrid 1 I want the:
- Number Type and,
- ContactNumber
to display in a second datagrid [Datagrid 2].
I can not work out how to get the values to bind to Datagrid 2, or how to set Datagrid 2 to lookup/display the Number Type.
Any help is greatly appreciated.
Cheers
Wedgetail
I am new to VB.net and database programing in general and have a question regarding the datagrid and databinding.
I have three tables with the following columns:
tblContacts:
- idContact
- FirstName
- Surname
tblContactNumbers:
- idContactNumber
- idContact
- idNumberType
- ContactNumber
tblNumberType:
- idNumberType
- NumberType
I have then set up relations between my two tables where:
- tblContacts.idContact to tblContactNumbers.idContact [one-many]
- tblNumberType.idNumberType to tblContactNumbers.idContact [one-many]
I have bound tblContacts to Datagrid 1.
When I select a record [contact] in Datagrid 1 I want the:
- Number Type and,
- ContactNumber
to display in a second datagrid [Datagrid 2].
I can not work out how to get the values to bind to Datagrid 2, or how to set Datagrid 2 to lookup/display the Number Type.
Any help is greatly appreciated.
Cheers
Wedgetail