hi, it will work:
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=IT-PC;Initial Catalog=collegeDB;User ID=sa; Password=12345;");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "Select timeupdate from timeLastUpdate";
using (con)
{
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
lblUpdate.Text = reader["timeupdate "].ToString();
lblUpdate.ForeColor = Color.Red;
if (Convert.ToDateTime(reader["timeupdate "].ToString()) < DateTime.Now.AddMinutes(-5))
{
Response.Redirect("underconstructionpage.aspx");
}
}
}
}