Column object, For Each Column in DataTable

Hi, I want to build a For Each loop that loops through columns in a DataTable.

Which Column object type do I specify as the data type?

There are quite a few options to choose from, not sure which one is correct. E.g. DocumentFormat.OpenXml, Xceed.Wpf.DataGrid, NPOI.SS.Formula etc etc

@DEATHFISH If you want to Loop or Iterate through the Column Names, then in the For Each Set the Type Argument as System.Data.DataColumn and use the Value as DT.Columns where DT is your Datatable variable.

4 Likes