Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to bypass the single qoute (') in search textbox asp.net c#
Posted
Comments
Aarti Meswania 9-May-13 9:04am    
search mean it's auto suggest
or search from database?
brighteyes24 9-May-13 10:09am    
yeah search from database..when i search john no problem..i can search i can see the profile information..but when i search john' there is a runtime error..my question is how to bypass the single quote..?
Orcun Iyigun 9-May-13 9:05am    
you do not want the user to type quote in the textbox? or is the textbox's text something that you use on a sql query? because the answer changes radically..

This link provides different ways to avoid quotes[^] in your textbox. But I strongly recommend you to use parametrized queries. You might have saved the day but later you might face a bigger one(SQL Injection). Here are some links for you to read:
Link 1[^]
Link 2[^]

Good luck,
OI
 
Share this answer
 
 
Share this answer
 
Comments
brighteyes24 9-May-13 10:25am    
thanks pallavi waikar...it helps.

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