Appending data to Datatable

Posted by Sathish on Stack Overflow See other posts from Stack Overflow or by Sathish
Published on 2010-03-31T06:45:02Z Indexed on 2010/03/31 6:53 UTC
Read the original article Hit count: 469

Filed under:

I am adding data to a dataset using the below code

cmdExcel.CommandText = "SELECT * FROM Table11"
dr = cmdExcel.ExecuteReader();
DataTable dtExcel = new DataTable("WK11");
dtExcel.Load(dr);
ds.Tables.Add(dtExcel);

Now i want to add the content from Table2 to the same datatable WK11. Is it possible?

cmdExcel.CommandText = "SELECT * FROM Table12"
dr = cmdExcel.ExecuteReader();
dtExcel.Append(.....

© Stack Overflow or respective owner

Related posts about c#