How would I do a linq query like this For example I want to count up all the numbers in a column and for it to return the result of them being added up
Thanks
How would I do a linq query like this For example I want to count up all the numbers in a column and for it to return the result of them being added up
Thanks
I find the LINQ to SQL samples site on MSDN to be an excellent reference for basic questions like this.
The Simple Sum example there is probably what you want:
// This sample uses Sum to find the total freight over all Orders.
void LinqToSqlCount03()
{
var q = (from o In db.Orders
select o.Freight).Sum()
}