Hi,

   I am stuck when I am trying to displaying a dataset with multiple
tables in DataGrid. I would like to display some columns in Table A,
and some columns in table B, table B is the child table of table A.

    When come to displaying, I create another DataTable, and try to
copy the columns I want from table A and table B, and want to combine
the columns into one table. Like below:

     DataTable newTable = new DataTable();
     newTable.columns.add(tableA.columns["abc"]);
     newTable.columns.add(talbeB.columns["edf"]);

 But I faild with the error "Column *** already belongs to another
DataTable."  I know that DataColumn is an reference object and a
reference can't can't be added to another table. Then there is no way
to copy a  column(I expected to have this: tableA.columns["abc"].copy
() ).

  I just want to display data from multiple tables. What should I do?
Any suggestions will be appreciate.

Vivienne Zhou

Reply via email to