public void refresh() { conn.Open(); cmd = new OracleCommand("Select * from Schedule_Details", conn); adapter = new OracleDataAdapter(cmd); adapter.Fill(dt); GridViewSchedule.DataSource = dt; GridViewSchedule.DataBind(); conn.Close(); }
protected void GetDoctorSchedule() { try { string CS = ConfigurationManager.ConnectionStrings["ConnectToPatientPortal"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) { string query = "Select DoctorProfile.*,UserAccounts.Username from DoctorProfile inner join UserAccounts on DoctorProfile.UserId=UserAccounts.UserId where DoctorProfile.DoctorId in(select DoctorId from Affiliations where InstituteId='" + Session["SelectedHospitalForDetailView"] + "')"; string query2 = "Select DoctorProfile.*,UserAccounts.Username from DoctorProfile inner join UserAccounts on DoctorProfile.UserId=UserAccounts.UserId where DoctorId='" + Session["SelectedDoctorForDetailView"] + "'"; string query3 = "select Affiliations.*,Institutes.* from Affiliations inner join Institutes on Affiliations.InstituteId=Institutes.InstituteId where Affiliations.DoctorId='" + Session["SelectedDoctorForDetailView"] + "'"; SqlDataAdapter da = new SqlDataAdapter(query3, con); DataTable dt = new DataTable(); da.Fill(dt); GridViewSchedule.DataSource = dt; GridViewSchedule.DataBind(); } } catch (Exception ex) { Session["Exception"] = ex; Response.Redirect("~/404.aspx"); } }