How to update the content of data rows in data table using Linq

Dear all,

How to update the content of data rows in data table using Linq (DT1.AsEnumerable()) (without a for loop iteration).

eg : I have a data table DT1
col1 col2
a1 20
b1 34
c1 45

I want to conver the values in col2 such that col2*10, which should result :

col1 col2
a1 200
b1 340
c1 450

I want to achieve this without a for loop.

Please post your replies and answers.

UpdateDataRowsLinq.xaml (7.8 KB)

Thanks!

2 Likes

THanks a lot. it works
Is there any documentation where we can learn all the available methods and samples.

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/

Please mark it as solution, so that it will help others.

Thanks!

@kadiravan_kalidoss
Is it possible to execue multiple statements in a single LINQ. ?