Click here to Skip to main content
11,412,400 members (64,603 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 23: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)

  Print Answers RSS
0 OriginalGriff 332
1 Sascha Lefévre 200
2 Maciej Los 135
3 ProgramFOX 130
4 Sergey Alexandrovich Kryukov 115
0 Sergey Alexandrovich Kryukov 9,025
1 OriginalGriff 7,247
2 Maciej Los 3,525
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | 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