How to add datacolumn in datatable dynamically using looping?using asp.net with c# language with example?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Nov 5, 2012, 3:26 AM EST
for (int i = 0; i < myArray.Count; i++)
{
string name = myArray[i]; d.Columns.Add(name);
}