Home > DeveloperSection > Forums > How to sum a field in a List
Chintoo Semi

Total Post:135

Points:947
Posted on    September-05-2014 12:10 AM

 VB.Net VB.Net 
Ratings:


 1 Reply(s)
 892  View(s)
Rate this:

I have:

 Dim aList As List(Of myObj.Answers) = myObj.GetResults(someID)

How can I get the sum of aList.AnswerCount field in my List(Of myObj) ?



Sumit Kesarwani

Total Post:378

Points:2694
Supported
Posted on    September-05-2014 12:31 AM

Hi Chintoo, 

try this:

aList.Sum(Function(i) i.AnswerCount)


Don't want to miss updates? Please click the below button!

Follow MindStick