Hello, I have a textbox for user to fill in. User might fill in an apostrophe. Is there a good way to translate it so when it is inserted in a table, it wouldn't generate an error? Thanks in advance for any expert insight.
Use ADO.NET Parameter objects. These will also take care of the case where the user enters a double-quote, a semi-colon, a double-dash, and other invalid characters.
Another benefit is that it protects you from SQL Injection, which is an attack where the bad guy can send arbitrary SQL commands to your database.
Chip H.
____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.