3
Answers

how to avoid single quote in sql queary

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)