| A | B | C | E |
supposed that, I have DataTabe and column is given above format now I want to add new column "D" in between C and E
How it possible. If it is possible then how plz Explain.
| A | B | C | E |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dipankar BiswasRank #992 · 2K reputationPosted Sep 18, 2014, 1:01 AM EDT
ds.Tables.Add(new DataTable());
ds.Tables[0].Columns.Add("column_1", typeof(string));
ds.Tables[0].Columns.Add("column_2", typeof(int));
ds.Tables[0].Columns.Add("column_4", typeof(string));
ds.Tables[0].Columns.Add("column_3", typeof(string));
//set column 3 to be before column 4
ds.Tables[0].Columns[3].SetOrdinal(2);
see more...
http://stackoverflow.com/questions/351557/how-does-one-insert-a-column-into-a-dataset-between-two-existing-columns