Try this
SqlCommand command = new SqlCommand();
command.CommandText = @"SELECT course.Courseno, subject.PaperName
FROM course INNER JOIN
ids ON course.Courseno = ids.Courseno INNER JOIN
subject ON ids.PaperID = subject.PaperID";
command.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
Dataset ds = new Dataset();
da.fill(ds) ;
GridViewID.DataSource = ds.Tables[0];