Parallel ForEach on DataTable

DataTable.Rows returns a DataRowCollection which only implements IEnumerable, not IEnumerable<DataRow>. Use the AsEnumerable() extension method on DataTable (from DataTableExtensions) instead:

Parallel.ForEach(dt.AsEnumerable(), drow =>
{
    ...
    Do Stuff
    ...
});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)