I'm using the groupby clause to compute averages. I'm just having problem with the syntax, hopefully someone can help me.
If you look at the code, the system nicely groups the data together and I can see by printing out the the group.Key values into a string. However it gives me an error when trying to group the group.Average() together. Obviously it does not know that it should average out keyerDuration. How do I state in the code to sort by the keyerDuration field?
It has to be something like mygroup.Average(reference to group.keyerRecord.keyerDur
var query = from keyerRecord k in arrylstPace
where keyerDuration > 0
group k by k.KeyerName;
foreach (var mygroup in query)
lblQuestion3Answer.Text += mygroup.Average() + " " + mygroup.Key;