private void LoadData(string dept) { string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; SqlConnection con = new SqlConnection(CS); string sql = "SELECT DISTINCT Dates, DateId FROM " + dept + " ORDER BY DateId ASC"; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); GridViewWeekDay.DataSource = rdr; GridViewWeekDay.DataBind(); con.Close(); //catch (Exception ex) //{ // if (ex != null) // { // Logger.Log(ex); // Server.ClearError(); // Server.Transfer("~/Application Error.aspx"); // } //} }
private void LoadData(string dept) { HttpCookie gatheredCookie = Request.Cookies["CourseCodes"]; string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; SqlConnection con = new SqlConnection(CS); string sql = "SELECT DISTINCT Day, DayID FROM " + dept + " WHERE Course IS NULL AND Teacher IS NULL ORDER BY DayID"; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); GridViewWeekDay.DataSource = rdr; GridViewWeekDay.DataBind(); con.Close(); //catch (Exception ex) //{ // if (ex != null) // { // Logger.Log(ex); // Server.ClearError(); // Server.Transfer("~/Application Error.aspx"); // } //} }