Shouldn't there be some single quotes in that select?
DataTable checktitle = DatabaseLayer.Retrive("select * from CourseTable where Title ='" + subjecttitletbox.Text.Trim() + "'");
Using string concatenation leaves you open to SQL injection by the way. If you used parameterized queries this problem would probably not have happened in the first place.
Unfortunately, I don't know what your
Retrive
method does. If it was me writing this, I would pass a list of parameters into a
Retrieve
method and make that method build the parameter list