How to Update multiple rows in datatable

datatable
studio

#1

Hi,
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 Datatable.select 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…

Regards,


#2

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…

Cheers


#3

Hi, @Florent_Salendres

Thank you for Quick Reply…
Regards,