"Cannot create a child list for field MyTable"

C

cpnet

I'm having a frustrating problem trying to set up a master-detail
relationship between 2 datagrids. I've used DataSets extensively before,
but only in code and basically only in a disconnected state. Now as I try
to set up this simple master-detail thing, I'm having problems.

I have about 6 tables in a SQL Server 2000 database. All tables have single
field primary keys, and I've created appropriate relationships betwen the
tables in SQL Server.

In VS 2003, I've created a SQLDataAdapter for each table, that interacts
with the table via stored procedures created by the SQLDataAdapter wizard.
I then used the "Generate Dataset..." functionality of one of the data
adapters to autogenerate dataset that included all 6 tables (i.e. it was
based on all 6 data adapters). So far so good. In the DataSet schema
editor, I created relationships between the datatables to mimic the
relationships in SQL Server. This seems to go ok, and when I "Preview
DataSet" from the schema editor, all seems ok - including the relationships.

I also have a WinForm that has 2 DataGrids on it. Both DataGrids have the
DataSet I created as their DataSource. When I try to list the DataTables in
the DataGrid.DataMember property so I can set up the DataGrids for the
master-detail, I the the error, "Cannot create a child list for field
MyTable", where 'MyTable' is one of my DataTables in the DataSet. If I
remove all of the relations from the DataSet, and save the .xsd schema a few
times (moving the datatables on the designer between saves so there's
something to save), the error will go away - but then I have no
relationships. So, I re-create the relationships in the DataSet schema
editor, and I start getting the error again. Sometimes I don't get the
error until I have more than one relationship, and sometimes by moving the
datatables on the schema designer and re-saving the dataset schema a few
times, I don't get the error - even when the dataset has 2 relationships.
It seems some code is getting corrupted somewhere. I've tried restarting
VS, and I've rebooted my machine. I've also deleted the DataSet and created
it again from scratch. The same thing happens.

When running my project, I can successfully fill my DataSet from the
DataAdapters, but I get the same error when I try to set the DataMember
property of one of the DataGrids in code.

What's going on?
 
C

cpnet

Well, whatever the problem is, it seems to be fixed?!?

Since yesterday, I installed the newest IE 6 critical update, and the
Infragistics 2004 vol 3 components. (I thought I'd try the same setup with
the Infragistics DataGrid to see what would happen). I re-created my
dataset the same way as before, and tried with the Infragistics DataGrid.
It worked fine with the Infragistics DataGrid. I then tired again with the
VS DataGrids, and they were fine. So, I created a brand new project (just
to be sure the Infragists Grids hadn't caused something to be added to the
project's References) and copied the .xsd for the DataSet into the new
project. In the new project I only added a VS DataGrid - no Infragistics
components. This too worked fine.

This is really weird - I have no idea what was causing the issue yesterday,
but it's working now.
 

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