Hello everybody!
I want to translate this simple SQL statement to linq-to-sql:
SELECT SUM(field1), SUM(field2)
FROM TableName
The closest linq-to-sql is (i think) using the group by clause:
from tbl in TableName
group tbl by (1) into g
select new{ value1= g.Sum(p => p.field1), value2 = g.Sum(p => p.field2)};
As this does not produce the expected outcome, what must be changed??
Thanks in advance