none
Child list for field RelLicData cannot be created.

    Question

  • "Child list for field RelLicData cannot be created."

     

    This is the error which I am getting in this line-->dgDataItemgrp.DataMember = "myTable.RelLicData";

     

               dsetView = dset.DefaultViewManager;
                dgDataItemgrp.DataSource = dsetView ;
                dgDataItemgrp.DataMember = "myTable.RelLicData";           
                DataRelation relLicData;
                DataColumn colMaster1 = new DataColumn();
                DataColumn colDetail1 = new DataColumn();
               
                colMaster1 = this.dset.Tables["myTable"].Columns["LicensegroupID"];
                colDetail1 = this.dset.Tables["myTable1"].Columns["LicensegroupID"];
                relLicData = new DataRelation("RelLicData", colMaster1, colDetail1);
                dset.Relations.Add(relLicData);


    any clue what can be the reason ?

    Thursday, July 10, 2008 7:20 PM

Answers

  • The DataGrid's DataMember should be the DataTable and not the DataColumn.
    What you should do is set the DataSource of the DataGrid to point to the DataSet (like you do) and set the DataMember property to the name of the DataTable
    (i.e dgDataItemgrp.DataMember = "myTable").

    hth,
    Lior.
    Friday, July 11, 2008 7:32 AM

All replies

  • The DataGrid's DataMember should be the DataTable and not the DataColumn.
    What you should do is set the DataSource of the DataGrid to point to the DataSet (like you do) and set the DataMember property to the name of the DataTable
    (i.e dgDataItemgrp.DataMember = "myTable").

    hth,
    Lior.
    Friday, July 11, 2008 7:32 AM
  • It worked Thanks Lior but what if I want to display output which is not the whole table I mean just some Columns from both the tables

     

    Thanks

    Friday, July 11, 2008 8:04 PM