siva nathan

siva nathan

  • 942
  • 828
  • 231.2k

Parallell foreach in DataRowView

Dec 16 2021 3:44 PM

Hi All,

 

I have a code like below

foreach (DataRowView drv in dv)

 {

 drv.SetAdded();
drv.BeginEdit();

drv["Username"] = drv["Name"].ToString().Trim();

drv.EndEdit();

}

due to number of rows it is getting slower ,how can i increase the performance of this code

can we use parallel foreach andhow to be write that code