Hi all
Using linq, to add two different columns and write it in the third column.
Ex
Col1
1
2
3
Col2
4
5
6
Total
5
7
9
All the columns belongs to the same sheet- sheet1.
Any idea?
Hi all
Using linq, to add two different columns and write it in the third column.
Ex
Col1
1
2
3
Col2
4
5
6
Total
5
7
9
All the columns belongs to the same sheet- sheet1.
Any idea?
@Ray_Sha1
have a check if following fits to your needs:
WriteBackCountResult.xaml (8.9 KB)
Data.xlsx (8.2 KB)
in general it is recommended:
Or
(From d In dtData.AsEnumerable
Let s = {0,1}.Sum(Function (x) Convert.ToInt32(“0” & d(x).toString.Trim))
Let ra = d.ItemArray.Take(2).Append(s).toArray
Select dtComputed2.Rows.Add(ra)).CopyToDataTable