How to Update multiple rows in datatable



I need to update multiple rows in DataTable…
I need to change the particular column value in all rows of the output comes from the query…

I am try with below statement. But its giving Error
Datatable.Select(“Name=‘Hemanth’”).ToList().ForEach(r =>r(“EmpId”)=“test”)

Anyone give suggestion for that problem…



List.ForEach is a Sub so i does not return a value.
Therefore it cannot be used within an assign.
You will have to use an Invoke Code if you want to achieve it that way AND using the Linq Lambd Synthax from VB as under.

Datatable.Select(“Name=‘Hemanth’”).ToList().ForEach(Sub(row) row(“EmpId”)=“test”)

Using a normal for each activity would be less confusing tho…



Hi, @Florent_Salendres

Thank you for Quick Reply…