First of all, this is a very bad of writing code. having SQL calls in RowUpdate is not a good programming method.
Now coming to your problem:
hemant_chauhan wrote:
I know i need to have a WHERE keyword in my query but i cant figure out what to write in the where clause
Looks like, you are trying to update course of a Student. If one student can have only one course, then, you need to define(or there muse be) a primary key associated with a student. Since primary Key's are unique, you can retrieve those before binding it to Gridview and extract that while updating as you did for name and course, then use that key in your where clause.
If student can have multiple courses, then you need to have a little normalized Database where again using primary keys you can update it.