How to compute Sum of a column?

Let say I have a column an excel file

with a column below:
Price
100
200
300
400
600

how can I compute it without looping using for each datatable?

Thanks!

Hi @alvin.c.apostol26

Try this
Sum=DT.AsEnumerable.Sum(Function(x) Cint(x(“Price”).ToString))

hi @alvin.c.apostol26

Use this expression.

dt.Compute(“SUM(Price)”, “”)

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