I would like to use the new Parallel.ForEach function to loop through a datatable and perform actions on each row. I am trying to convert the code below:
DataTable.Rows returns a DataRowCollection which only implements IEnumerable, not IEnumerable. Use the AsEnumerable() extension method on DataTable (from DataTableExtensions) instead:
Parallel.ForEach(dt.AsEnumerable(), drow =>
{
...
Do Stuff
...
});