<pre>/// ******************************************************************** /// <summary> /// Get details of all upcoming courses. /// </summary> /// ******************************************************************** public List<Course> GetUpcomingCourses(Course c) { List<Course> courseList = new List<Course>(); con.ConnectionString = conString; con.Open(); try { using (con) { SqlCommand cmd = new SqlCommand(GetUpcomingCoursesCommandText, con); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { c.CourseID = Convert.ToInt32(rd["CourseID"]); c.Name = Convert.ToString(rd["Name"]); c.Date = Convert.ToDateTime(rd["Date"]); c.StartTime = Convert.ToString(rd["StartTime"]); c.EndTime = Convert.ToString(rd["EndTime"]); c.Description = Convert.ToString(rd["Description"]); c.Location = Convert.ToString(rd["Location"]); courseList.Add(c); } } } finally { con.Close(); } return courseList; }
Course
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)