In a vb.net 2010 application, I have just written the following code where data is obtained from the database and stored in the dataset called _dtreasonsnonattendance.
dim String columnname
For i = 0 To _dtreasonsnonattendance.Rows.Count() - 1
columnname = _dtreasonsnonattendance.Rows(i)(_dtreasonsnonattendance.Columns(7).ColumnName()).ToString()
next
In the part of the statement listed above, when I hover over the 'ColumnName()' part of the statement listed above, I see the actual column name. I want the assignment statement to actually obtain the column name. Thus would you show me the code on how I can accomplish my goal?

Midhun TpRank #388 · 6.5K reputationPosted Aug 11, 2016, 8:40 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 11, 2016, 8:01 AM EDT
dcRank #2,247 · 627 reputationPosted Aug 11, 2016, 8:32 AM EDT