Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
905
Many to Many Hierarchical Bind?
posted

 

I have read several posts on this in the forums, but I can't seem to grasp exactly how to code a many-to-many Heirarchical WebGrid. The bind is what is giving me problems. Lets say I have the following:

Distributors - Table of Distributors
DistributorsCriteria - Table of what Distributors may sell
DistributorsCriteriaMap - Table mapping the two together

 In my bind function, I have the Distributor first:

 Dim cmdDistributors As New OleDbDataAdapter("select id, title, company_name, address1, address2, city, state_id, zip_code FROM Distributors", oleDbConnection1)

then, to bpopulate the Child (Band(1) I suppose I need to somehow matchup only the criteria for the specific distributors. SO, I am thinking something like:

Dim cmdDistributorsCriteria As New OleDbDataAdapter("select id,criteria,description from DistributorCriteria where DistributorCriteria.id = DistributorCriteriaMap.criteria_id and DistributorCriteriaMap.distributor_id = ??????", oleDbConnection1)

Note the ?????? above, I can't figure out how to "relate" thse two tables together properly with the third (map) table. 

Maybe there is a better way to do this, but I am using th Infragistics sample as my guide from: http://samples.infragistics.com/2007.3/webfeaturebrowser/contents.aspx?t=WebGrid/HierarchicalGrid/HierarchicalGrid.aspx%7Esrcview.aspx?path=../webfeaturebrowservb/WebGrid/HierarchicalGrid/HierarchicalGrid.src%7Esrcview.aspx?path=WebGrid/HierarchicalGrid/HierarchicalGrid.src