If you create a list then you are half way there. What I would do is go one stage further, and create a class to hold the values, and then build a list of the class instances:
public class UserScore
{
public int ID { get; set; }
public int Number { get; set; }
public int Value { get; set; }
public double Score { get; set; }
public UserScore(int id, int number, int value, double score)
{
ID = id;
Number = number;
Value = value;
Score = score;
}
}
You can then construct a List of the class and fill it:
List<userscore> list = new List<userscore>();
list.Add(new UserScore(100, 1, 2, 10));
list.Add(new UserScore(300, 1, 2, 9));
list.Add(new UserScore(200, 1, 4, 11));
list.Add(new UserScore(100, 2, 3, 10.5));
list.Add(new UserScore(200, 2, 4, 10));
You can then use Linq to group the results:
var totals = from uc in list
group uc by uc.ID into g
select new { ID = g.Key, TotalScore = g.Sum(x => x.Score) };
[edit]Spurious XML removed[/edit]