How to use PLINQ to update datatable

  • Thread starter Thread starter Sudip_inn
  • Start date Start date
S

Sudip_inn

Guest
suppose this way i am updating my datatable

dtFilterDataFromAllData.AsEnumerable()
.Where(a => a.Field<string>("TabName") == TabName
&& a.Field<string>("StandardLineItem") == StandardLineItem
&& a.Field<bool>("cumulative").ToString().ToUpper() == "TRUE"
&& a.Field<string>("StandardDate") == StandardDate.Replace("1Q", "2Q")).ToList<DataRow>()
.ForEach(y =>
{
y["StandardValue"] = dblcumulativeValue;
});
dtFilterDataFromAllData.AcceptChanges();


in above code if i use AsParallel then getting exception. may be encounter this exception

Collection was modified. enumeration operation might not execute



so how to use PLINQ during updation of datatable.

please help me with sample code using PLINQ for update. thanks

Continue reading...
 
Back
Top