3

how can in load a DataTable to an existing table in my DataSet. something like this:

DataTable my_table = new DataTable("sale_info");
**add some row to my_table **
myDataSet.Tables.Add(my_table);

i have a table named sale_info in myDataset too and myDataSet.Tables.Add(my_table); is trying to add new one. actually i want update my table with new data from another table.

hamze
  • 7,061
  • 6
  • 34
  • 43

1 Answers1

4

You can call myDataSet.Tables["sale_info"].Merge(my_table).

However, you should simply add the rows directly to the existing table rather than creating a new table.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964