Parallel ForEach for Datatable columns

I want to iterate through the columns of a datatable and this loop should be inside another loop that loops through the rows of the datatable. The problem is when I try to specify “datatable.columns” in the values section of the parallel for each, (type argument is set to DataColumn), it shows an error like this "Option strict on disallows implicit conversions from ‘System.Data.DataColumnCollection’ to ‘System.Collections.Generic.IEnumerable(Of System.Data.DataColumn)’ "

Hi,

Can you try dt.Columns.Cast(Of DataColumn) instead of dt.Columns?

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.