Master/Detail sample?

G

Guest

I was working with the sample given for master detail and so far I have:

' Bind the master data connector to the Manual Order table.
_masterBindingSource.DataSource = _dsManualOrder
_masterBindingSource.DataMember =
_dsManualOrder.dtManualOrderItem.TableName

' Bind the details (order discount) data connector to the master
' data connector, using the DataRelation name to filter the
' information in the details table based on the current row
' in the master table.
_detailsBindingSource.DataSource = _masterBindingSource
_detailsBindingSource.DataMember =
_dsManualOrder.dtManualOrderItemDiscount.TableName

The problem is when I set the DataMember for the details (last step above) I
get an exception:

Message = "DataMember property 'dtManualOrderItemDiscount' cannot be found
on the DataSource."

I created some debug code to see what tables were available and:

For Each dt As DataTable In _dsManualOrder.Tables
Debug.WriteLine(dt.TableName)
Next

Yields:

dtManualOrderItem
dtManualOrderItemDiscount

So I guess I am confused as to why the table is not found.

Kevin
 
G

Guest

Change this line to read.

_masterBindingSource.DataMember = "dtManualOrderItem"

I hope that helps.
 
G

Guest

Thank you for your response. The TableName was/is set to the string that you
specified. I think I found the problem though. When I specify the detail
DataSource as the BindingSource for the master I specified a DataMember that
was a table name and it should be the DataSet name.

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top