protected void SlotpickerBtn_Click(object sender, EventArgs e) { string query = "SELECT m_open, m_close, e_open, e_close FROM doc_timings WHERE doc_id = '" + Session["docid"] + "'"; var reader = all.ExeReader(query); if (reader.Read()) { mOpen = Convert.ToInt32(reader["m_open"]); mClose = Convert.ToInt32(reader["m_close"]); eOpen = Convert.ToInt32(reader["e_open"]); eClose = Convert.ToInt32(reader["e_close"]); } all.CloseConnection(); string query1 = "select convert(char(5), slot_time , 108) [time],slot_id from doc_slots where slot_id >= '" + mOpen + "'AND slot_id <='" + mClose + "' AND slot_id not in (select Slotid from BookingDetails where Date ='" + datepicker.Text + "')"; all.Repeater(MorningSlotRptr, query1); string query2 = "select convert(char(5), slot_time , 108) [time],slot_id from doc_slots where slot_id >= '" + eOpen + "' AND slot_id <='" + eClose + "' AND slot_id not in (select Slotid from BookingDetails where Date ='" + datepicker.Text + "')"; all.Repeater(EveningSlotRptr, query2); MorningSlotRptr.Visible = true; EveningSlotRptr.Visible = true; head1.Visible = true; head2.Visible = true; SlotpickerBtn.Visible = false; BookAppointmentBtn.Enabled = true; }