Click here to Skip to main content
11,501,968 members (65,425 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 OleDb
Syntax error in query expression 'Firstname LIKE % Hello %'.

please Help me solve this.
Posted 10-Jan-13 22:04pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

must be like this:
Firstname LIKE '% Hello %'.
  Permalink  
Comments
Member 9430088 at 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 at 11-Jan-13 4:16am
   
after extecuting query bind your datagridvieww again..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Shouldn't be
Firstname LIKE '% Hello %'
?
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100