Change this line
ddlcoursename.Text = (cmd.Parameters["@COURSE_ID"].Value).ToString();
with
ddlcoursename.SelectedValue= (cmd.Parameters["@COURSE_ID"].Value).ToString();
Also make sure that you have filled the dropdownlist before this line of code. This is the most possible cause of the error you are getting.
In case this doesn't resolve the problem, let me know :)