Create datatable from other datatable
suppose i have 10 rows in one datatable now i have to make another datatable with last four column of previous datatable and than add 10 rows to current datatable .how to do this..
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

JohnRank #2,322 · 608 reputationPosted Jul 15, 2016, 3:08 AM EDT
Vishal JadavRank #1,692 · 901 reputationPosted Jul 15, 2016, 3:34 AM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Jul 15, 2016, 3:36 AM EDT
DataRow[] rowArray = Datatable1.select(“ID in (7,8,9,10)”);
foreach (DataRow row in rowArray) {
dataTable2.Rows.Add(row);
}