开发者

Appending data to Datatable

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.Ex开发者_开发百科ecuteReader();
dtExcel.Append(.....


you can use the

dtExcel.ImportRow() 

function which will append new row to the dtExcel Table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜