Tuesday, April 14, 2015

Linq sum column in datatable

https://msdn.microsoft.com/en-us/library/bb534801.aspx

http://www.codeproject.com/Questions/627915/How-will-get-a-column-sum-of-datatable-using-LINQ

  Dim totalGenerated As Integer = dt.AsEnumerable().Sum(Function(dr) dr.Field(Of System.Int32)("fieldNameWhichIsANumber"))

No comments:

Post a Comment