Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
H!
I have created asp.net C# application that accepts student marks and calculate the totals,average and grade letters and insert the entered marks in the db. the marks are entered using text boxes. The computed marks and grades are displayed on labels. i want these totals and grades to be stored in the db as well. i have the columns for totals, average and overal grade in the label.
How can i store the data displayed on the labels into the labels?

Thank you for your help.
Posted
Comments
[no name] 25-Jun-13 11:11am    
"How can i store the data displayed on the labels into the labels?", I am going to assume that you mean storing the label data into the database and not into a label. You would store the label data into the database the exact same way you are storing the other data.

I prefer that,

Fist start giving the name of the label same as field name.
Ex. your field name is StudName than label name should be lblstudname here lbl is use for identify label controller.

Now There is property of label named as Text; this will help you for fetching data of label.
Ex. lblstudname.Text this will return student name

Store it in database.
 
Share this answer
 
LabelID.Text has the value you are looking for . Consider changing the data-types as per you table column.
 
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