protected void Page_Load(object sender, EventArgs e) { lblDate.Text = DateTime.Now.ToString("dd MMM yyyy"); lblDay.Text = DateTime.Now.ToString("dddd"); lblTime.Text = DateTime.Now.ToString("hh:mm:ss tt"); serialPort1.PortName = "COM6"; serialPort1.BaudRate = 9600; SqlOperation op = new SqlOperation(); MySqlDataReader dr = op.getInterval(int.Parse(Session["userid"].ToString())); dr.Read(); interval = int.Parse(dr.GetValue(8).ToString()); Timer3.Interval = interval * 1000; serialPort1.Open(); temp = serialPort1.ReadLine(); reading = serialPort1.ReadLine(); description = serialPort1.ReadLine(); serialPort1.Close(); lblTemp.Text = temp; lblReading.Text = reading; }