Click here to Skip to main content
15,888,280 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have a table Exams and column examHours of int type. it saves the exam completion hours in minutes(e.g 70).

now this value should decrease in every second and updated value will be visible in a label.

what i am doing is...
public partial class GiveExam : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string strtitle = Request.QueryString["title"];
            string examID = Request.QueryString["exmid"];
            LblExmNm.Text = strtitle;
            SqlCommand cmd = new SqlCommand("select distinct examHours,totalQn from dbo.Exams where examID=@examID");
            cmd.Parameters.AddWithValue("@examID", examID);
            DataSet ds = GlobalConnect.ExecuteDataSet(cmd);
            if (ds != null && ds.Tables.Count > 0 )
            {
                lblTotQns.Text = ds.Tables[0].Rows[0][1].ToString();
                int TotalTime = Convert.ToInt32( ds.Tables[0].Rows[0][1].ToString());//here value is 70
            }
           
        }
    }
}


please suggest me what should i do, can i use here timer?
thanks.
Posted
Comments
Tom Marvolo Riddle 22-Nov-13 7:13am    
Sure.you can use timer here
[no name] 22-Nov-13 7:16am    
but sir timer control is not present in my toolbox, where from to get it.
Tom Marvolo Riddle 22-Nov-13 7:20am    
you will get timer in Ajax extension(Toolbox)
Tom Marvolo Riddle 22-Nov-13 7:43am    
if you not get it then try to download it.You can get lot of article for this question and of course check solution 1.

 
Share this answer
 
 
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