Update datatable using Linq

Hi,

I am having a datatable similar to below. I want to update the “Company” column for row where Id = 2 to “TCS”. Is it possible to do it using Linq or any other method apart from using iteration?

Thanks!

@Kapil

Use invoke code with below and send dt and in/out

Dt.AsEnumerable.Where(function(x) x("id").ToString.Equals("2")).ToList.ForEach(sub(r) r("Company") = "TCS")

Cheers

1 Like

@Kapil
through invoke activity can do!!

For Each row As DataRow In dt.AsEnumerable
If(row(0).ToString=“2”) Then
row(1)=“Tcs”
End If
next

Cheers!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.