In an asp.net page I have five gridviews listing some numbers. In the header of each gridview I want to summarize the numbers in the listings. So if the listing contains rows with numbers 1,2,3 the title in the header would be 6.
I can't find a way to do it in my query for the gridview (SELECT number,SUM(number) FROM tbl, is not working).
It seems like a bad way to connect to the database again to sum these numbers, as I'm already connecting five times to get the data for the gridviews.
What is the best solution for doing this?
Thanks!