Beleebe

I converted my VS2003 app to VS2005 Pro. Everything is fine except that one or two datasets are causing problems. If I run the form in question, the following code is highlighted -

((System.ComponentModel.ISupportInitialize)(this.dsMySalesInvoice)).EndInit();


and the message is "Child list for field Customer cannot be created". Supprisingly, the Customer datatable does not even belong to that dataset. The Customer datatable belongs to an untyped dataset called(CustomerDataSet). I have generated a new dataset for the dataadapters and worked for a while. After making some significant changes the new one is now behaving the same way. I need help, please.



Re: .NET Framework Data Access and Storage "Child list for field 'Customer' cannot be created".

PJ. van de Sande

How do you fill the dsMySalesInvoice, there must be and relation to the customers table.





Re: .NET Framework Data Access and Storage "Child list for field 'Customer' cannot be created".

Beleebe

Thank you so much for the prompt reply. The following are two code samples using the dataset --

private void GetPriceAndUnitsInStockFromWarehouse()

{

try

{

this.dsMySalesInvoice.GetPriceAndBalanceFromWarehouse.Clear();

this.cmdPAndBFWH.Parameters["@Warehouse"].Value = this.cboWarehouse.Text;

this.daPAndBFromWH.Fill(this.dsMySalesInvoice, "GetPriceAndBalanceFromWarehouse");

}

catch(Exception e)

{

MessageDialogForm msg = new MessageDialogForm();

msg.DialogCaption = "Warehouse";

//msg.DialogMessage = "An error occured while trying to get price and stock balances form warehouses";

msg.DialogMessage = e.Message;

msg.ShowDialog();

}

}

private void GetWarehouses()

{

try

{

this.cmdUWH.Parameters["@UserID"].Value = LoggedInUser.WhatIsMyID;

this.daUserWH.Fill(this.dsMySalesInvoice, "GetUserWarehouse");

}

catch

{

MessageDialogForm msg = new MessageDialogForm();

msg.DialogCaption = "Warehouse";

msg.DialogMessage = "An error occured while trying to get warehouses";

msg.ShowDialog();

}

}

The two dataset do not have any relation whatsoever.

Thanks in advance.





Re: .NET Framework Data Access and Storage "Child list for field 'Customer' cannot be created".

Blackstaff

Be sure that your classes and variable names are dissimilar. I've experienced this error when defining a a variable as a class which contains a dataset, then fat-fingering the assignment of the dataset to the ClassName.DataSet rather than VarName.Dataset.

Just a suggestion.





Re: .NET Framework Data Access and Storage "Child list for field 'Customer' cannot be created".

Simpzon

I quess you have fixed that one, but for those who hit this post when googling for this error message:
I have experienced this error after renaming some DataSet schema. A DataGrid bound to an instance of this Dataset has been initialized to use a Table of the grid as DataMember. Since this assignment is done using a string instead of an object reference to the DataTable, the assignment did not match the renamed tablename anymore. using theTableObject.TableName instead of the simple string assignment fixed the issue.




Re: .NET Framework Data Access and Storage "Child list for field 'Customer' cannot be created".

carso

The reason that you have this error is because you have not set the datagridview.dataMember name correctly. Just make sure the xml table name is matched.

Please refer to this example:

http://carso-owen.blogspot.com/2007/08/read-xml-data-and-bind-to-datagridview.html






Re: .NET Framework Data Access and Storage "Child list for field 'Customer' cannot be created".

kavallo

Not put the datamember.