Click here to Skip to main content
16,012,759 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a StudentResult Table..

where field id :
StudentID SubjectCode Marks.
1001 BB101 80
1001 BB102 90
1001 BB103 70
1002 BB101 70
1002 BB102 70
1002 BB103 60



I want to display Total Grouping result into asp.net gridview :

StudentID Total Marks
1001 240
1002 200
Posted
Comments
kumar2413 11-Jun-13 1:55am    
What you have tried so far?

SQL
SELECT StudentId,SUM(Marks) As TotalMarks 
FROM Tablename
Group By StudentId


Try this and see.
 
Share this answer
 
select StudentID,sum (Marks) as Total Marks from tablename group by StudentID

use this Query and Bind the result to the Grid View like this

gridview.datasource=ds.tables[0];(datatable or dataset which u used)
gridview.databind();





please select as answer if it helps....
 
Share this answer
 
v2
This link[^] should help you out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900