//Example to define how to do :
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("FirstName");
dt.Columns.Add("LastName");
dt.Columns.Add("Address");
dt.Columns.Add("City");
// The table structure is:
//ID FirstName LastName Address City
//Now we want to add a PhoneNo column after the LastName column. For this we use the
//SetOrdinal function, as iin:
dt.Columns.Add("PhoneNo").SetOrdinal(3);
//3 is the position number and positions start from 0.`enter code here`
//Now the table structure will be:
// ID FirstName LastName LastName PhoneNo Address City
आप ऐसा क्यों करना चाहते हैं? कॉलम का क्रम वास्तव में प्रासंगिक नहीं होना चाहिए। –
कभी-कभी यदि आप डीबी से डेटा प्राप्त करने के बाद डेटाटेबल में कॉलम जोड़ रहे हैं तो आपको इसे भिखारी पर सेट करने की आवश्यकता हो सकती है। –
मैं थोक थोक – Grant