Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multitable bindingsource

Status
Not open for further replies.

hambakahle

Programmer
Nov 5, 2014
8
US
I have 2 related tables: tblItem (child) and tblSetItem (master). I am attempting to filter tblSetItem and obtain a related subset from tblItem. Can anyone comment on why an exception is being raised:

"DataMember property 'tblSetItem_tblItem' cannot be found on the DataSource."

I can iterate through the datasource’s parentrelations and find it.

Code:
 Dim dr As DataRelation = DbItemsBEDataSet.Relations("tblSetItem_tblItem")
        tblSetItemBindingSource.Filter = "SetID = 28"
        If tblSetItemBindingSource.Count > 0 Then

            Dim bsItemSetItem As New BindingSource
            bsItemSetItem.DataSource = DbItemsBEDataSet.tblItem  'TblItemBindingSource
	     ‘EXCEPTION HERE - DataMember property 'tblSetItem_tblItem' cannot be found on the DataSource.
            bsItemSetItem.DataMember = dr.RelationName 'DbItemsBEDataSet.tblItem.ParentRelations.Item("tblSetItem_tblItem").RelationName
 
     MsgBox(bsItemSetItem.Count) 
        End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top