Data relation with 3 tables

  • Thread starter Thread starter Shan1986
  • Start date Start date
S

Shan1986

Guest
Hallo,

I have 2 combo boxes and i want to filter or show the data in a data grid view based on the 2 combo boxes, i know i can filter the table or binding source in many ways but just want to know if it possible to do it via data relations.

I want to show the table 3 in data grid view based on the value from table 1 & 2 how to add data relation for the following setup if possible.

1615816.gif

DS.Relations.Add("Tab1toTab3", Tables("Tab1").Columns("Col1"), Tables("Tab3").Columns("Col1"))
DS.Relations.Add("Tab2toTab3", Tables("Tab2").Columns("Col2"), Tables("Tab3").Columns("Col3"))


Dim BS1 As New BindingSource With {.DataSource = DS, .DataMember = "table1"}
Dim BS2 As New BindingSource With {.DataSource = BS1, .DataMember = "Tab1toTab3"}
Dim BS3 As New BindingSource With {.DataSource = BS2, .DataMember = "Tab2toTab3"} '''this does not work


is it possible to something like this? thanks

Continue reading...
 
Back
Top