Click here to Skip to main content
15,898,769 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have a one textbox and i want to store textbox's value in sql but when i enter any text with single qoute (') in textbox and click save button then give a error please give a solution hurrey

thanks you
Posted

You want to avoid allowing characters like that into your data due to SQL injection. Here's a link I found (using google) that provides some info on what you're trying to do.

http://it.toolbox.com/wiki/index.php/How_do_I_escape_single_quotes_in_SQL_queries%3F[^]

I googled with this phrase - "sql quote characters in field".
 
Share this answer
 
You need to use parameters. This is another good article here on Code Project:

SQL Injection Attacks and Some Tips on How to Prevent Them[^]

Nick
 
Share this answer
 

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