public void getcourses(int term) { var services = new DAL.DAL(); Connection_StringCLS connstr = new Connection_StringCLS(Campus); int sem = 0; int Year = LibraryMOD.SeperateTerm(term, out sem); int iYear = Year; int iSem = sem; string studentid = Session["CurrentStudent"].ToString(); DataTable dt = services.GetCoursesbyStudentId(studentid, connstr.Conn_string, iYear, iSem); if (dt.Rows.Count > 0) { drp_Course.DataSource = dt; drp_Course.DataTextField = "Course"; drp_Course.DataValueField = "Code"; drp_Course.DataBind(); drp_Course.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Course---", "---Select a Course---")); } else { drp_Course.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Course---", "---Select a Course---")); } }
public void getcourses() { var services = new DAL.DAL(); Connection_StringCLS connstr = new Connection_StringCLS(Campus); int sem = 0; int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem); int iYear = Year; int iSem = sem; string studentid = Session["CurrentStudent"].ToString(); DataTable dt = services.GetCoursesbyStudentId(studentid, connstr.Conn_string, iYear, iSem); if (dt.Rows.Count > 0) { chk_Courses.DataSource = dt; chk_Courses.DataTextField = "Course"; chk_Courses.DataValueField = "strLecturerDescEn"; chk_Courses.DataBind(); } }