Totaling data using another gridview

Posted by Jammyhunt under ASP.NET on 1/26/2014 | Points: 10 | Views : 658 | Status : [Member] | Replies : 2

i have a gridview like this

name subject marks

ankit maths 20

rajesh maths 30

ankit science 50

ankit english 70

rajesh english 30

rajesh science 50

rahul english 70

i want to total the marks of each person and show in gridview.

like this

no. name total marks

1 ankit 140

2 rajesh 110

3 rahul 70


Posted by: Snaveen on: 2/13/2014 [Member] Starter | Points: 25


dont do this type of complex actions in your application you can do this on your stored procedure itself. Based on name of the person you just grouping and calculate the sum of the marks.


select sum(marks),name

from tablename
groupby name

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response