Khargesh Rajput

Khargesh Rajput

  • NA
  • 5.6k
  • 603.9k

how to avoid single quote in sql queary

Oct 22 2014 12:07 AM
I have To search data from database.
 
My query is like as
 
select * from table where subject like'%'+txtsearch+'%'
 
and here my textbox has value like -----  teacher's book
this query will give error as syntax error near----- 's
Then how to execute my query,i don't  want to remove single quote
 

Answers (3)