I\'m using a DataTable with the contents
DataTable
column1 column2 column3 column4 column5 column6 column7 column8 column9 column10 row1 a
int cnt = 0; foreach (string s in colsList) { if (table.Columns.Contains(s)) { table.Columns[s].SetOrdinal(cnt); cnt++; } }
count need not to be the same.