Loop table columns and delete
Posted on 2007-07-27
i want to loop through a datarow and it the value is 0 i would like to delete that column.
i have got so far but when i delete the column it causes a problem in the loop statement. i have come across this recently in another situation an i was told to loop backwards, but how can i do this when looping a list of columns.
my current code is;
Dim dci As Integer = 0
For Each c As DataColumn In ds.Tables("Grid").Columns
If drw.Item(dci) = "0" Then
dci = dci + 1