Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Syntax error in query expression 'Firstname LIKE % Hello %'.

please Help me solve this.
Posted

must be like this:
SQL
Firstname LIKE '% Hello %'.
 
Share this answer
 
Comments
Member 9430088 11-Jan-13 4:12am    
When i execute this nothing happens
the datagridview does not update

public void Search()
{
OleDbCommand ocm = new OleDbCommand("SELECT Firstname FROM students WHERE Firstname LIKE '% Hello %' ", conn);
conn.Open();
ocm.ExecuteNonQuery();
conn.Close();


}
prashant patil 4987 11-Jan-13 4:16am    
after extecuting query bind your datagridvieww again..
Shouldn't be
SQL
Firstname LIKE '% Hello %'

?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900