Avatar of accmats
accmats
 asked on

How to handle Apostrophe from text boxes when they are used with SQL statements

I have a website with an order entry form.  The customers have to type in the name, address, etc.  Some times their company name contains an Apostrophe.  When I read the text box and and write it to a string that becomses my SQL statment, it causes problems on the SQL side.  It thinks the Apostrophe is the end of the field.

How can I handle this?  How do I allow my customers to enter in Apostrophes that won't screw up sql.  Also I would rather not have to redo all my code and used stored procedures if there is another workaround.

Thanks for all your help!!!
ASP.NET

Avatar of undefined
Last Comment
nauman_ahmed

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mrichmon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Allan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23