locked
"Child list for field 'Customer' cannot be created". RRS feed

  • Question

  • 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.

    • Moved by VMazur Friday, August 7, 2009 10:18 AM (From:ADO.NET Data Providers)
    Thursday, April 6, 2006 7:52 AM

Answers

All replies

  • How do you fill the dsMySalesInvoice, there must be and relation to the customers table.
    Thursday, April 6, 2006 8:20 AM
  • 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.

    Thursday, April 6, 2006 8:51 AM
  • 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.

    Sunday, April 30, 2006 8:01 PM
  • 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.
    Monday, March 12, 2007 2:28 PM
  • 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

     

     

     

    Thursday, August 9, 2007 9:56 AM
  • Not put the datamember.
    • Proposed as answer by KunalShah Thursday, August 6, 2009 5:28 AM
    Friday, February 8, 2008 3:15 PM
  • Setting the datamember property before the datasource would resolve the error in few of the cases
    Thursday, August 6, 2009 5:29 AM
  • This can also happen if you're debugging and you have the DB open at the same time.
    • Proposed as answer by templersstorms Monday, February 22, 2010 3:48 PM
    Wednesday, December 16, 2009 2:46 PM
  • "This can also happen if you're debugging and you have the DB open at the same time."

    This just saved me soooo much headache. Thanks a million.
    Monday, February 22, 2010 3:49 PM