Posted on: 9/14/2015 8:18:31 PM | Views : 806

Newbie to asp.net. I am trying to get Course by Id when user click on specific Course the page navigate to another page where its only shows the specific Course by its ID. I have my GetCourse by ID method below. I have also created object.
my question is i have no clue how to pass parameter in that object to get specific course by its ID. 
//Get a Course by ID public static Course GetCourse(int id) { Course a = new Course(); String GetCommand = "Select ID CourseName, Description, StartDate, EndDate, CourseMode from Course" + "Where ID = @CourseID"; SqlConnection connection = DBManager.GetSqlConnection(); SqlCommand command = new SqlCommand(GetCommand, connection); command.Parameters.AddWithValue("@CourseID", id); try { var reader = command.ExecuteReader(); ...

Go to the complete details ...