Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all,
i want to display total amount in label for particular persons without using gridview in asp.net 2010 and sql server2008.



name total amount

aaaa 45667
sgdgfdh 45889
display like this
Posted
Comments
Maciej Los 16-Dec-14 6:27am    
What have you done? WHere are you stuck? What's an issue?

I would suggest the SQL SUM function[^].
 
Share this answer
 
Comments
Member 11264646 16-Dec-14 7:16am    
i have completed only display one student totalmark in label...
Member 11264646 16-Dec-14 7:20am    
name is displayed in hyperlink
here is my code


string str2 = "Select Sum(mark) as Total , from tbl_uploading where se_name = '" + HyperLink1.Text + "'";


SqlCommand cmd2 = new SqlCommand(str2, con);


SqlDataReader dr2 = cmd2.ExecuteReader();


dr2.Read();
Label14.Text = dr2["Total"].ToString();



dr2.Close();
use aggregate function in sql and assign the retrieved value to a label
 
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