Master - Detail problem...

J

Jan Nielsen

Hi
I have a typed dataset with a Master table (tblPersons) and a Detail table
(tblRemarks).
I have a Winform which shows person data (master data)
I would like to have a datagrid showing the detail data.
So I try to bind the datagrid like this:
DataSource: MyDataSet
And try to set DataMember to: tblPersontblRemarks
But I get an error:

"Invalid Property Value:"
"DataBinding could not find a row in the list that is suitable for all
bindings"

And then when I press OK
I receive another error:
"Datasources of type System.DBNull are not supported.
Parameter name: Datasource"

If I rightclick on a dataadapter and select Preview Data... it works fine.


Best regards

Jan
 
M

Miha Markic

Hi Jan,

Strange.
What does your DataTable tblPersontblRemarks looks like?
Does it have a boolean column?
Which VS.NET version are you using?

Jan Nielsen said:
Hi
I have a typed dataset with a Master table (tblPersons) and a Detail table
(tblRemarks).
I have a Winform which shows person data (master data)
I would like to have a datagrid showing the detail data.
So I try to bind the datagrid like this:
DataSource: MyDataSet
And try to set DataMember to: tblPersontblRemarks
But I get an error:

"Invalid Property Value:"
"DataBinding could not find a row in the list that is suitable for all
bindings"

And then when I press OK
I receive another error:
"Datasources of type System.DBNull are not supported.
Parameter name: Datasource"

If I rightclick on a dataadapter and select Preview Data... it works fine.

DataAdapter has nothing to do with this error..
 
J

Jan Nielsen

Hi Miha
Thanks for answering

tblPersontblRemarks is not a datatable but a one-many relation between the
tables tblperson and tblremarks. (One person - Many remarks)
No, there is no booleans in neither of the tables.
I am using
Microsoft Development Environment 2002 version 7.0.9466 and
Microsoft .Net framework 1.1 version 1.0.3705

Best regards

Jan
 
J

Jan Nielsen

Hi again Miha
to make it even more strange I tried to create another solution.
I made a completely new dataset with only the two datatables in question,
added a relation and added some controls on a form to test it and it worked
perfect.
But it still doesn't work in my original solution.

Jan
 
J

Jan Nielsen

To complete the mystery:
When I opened the .vb file and edited the code manually it worked with no
problems.
Me.DataGrid1.DataMember = "tblPerson.tblPersontblRemarks "

Well thanks for your time

I am puzzled, but happy it works

Jan
 

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