is not an error. It is a statement. Please post the text of the error message. Because the source of the error is likely the query, please also post the value of SqlQuery. It would also help to know the field types of your database table. For example, if grade is a string then the query may be OK. If grade is a number then you shouldn't have single quotes around the value for grade.