public void GetAllCourseByStudent() { EnrollCourse _EnrollCourse = new EnrollCourse(); _EnrollCourse.DepartmentId = Convert.ToInt32(DepartmentDropDownList.SelectedValue); CoursesDropDownList.DataSource = _EnrollCourseManager.GetAllCourseByStudent(_EnrollCourse.DepartmentId); CoursesDropDownList.DataTextField = "CourseName"; CoursesDropDownList.DataValueField = "CourseCode"; CoursesDropDownList.DataBind(); CoursesDropDownList.Items.Insert(0, new ListItem("Select Courses", "0")); }