Groups | Blog | Home
all groups > asp.net announcements > june 2005 >

asp.net announcements : problems with inputtext in ASP.NET


Nicole
6/1/2005 7:16:04 AM
In a windowsform an inputtext is written (SQL-statement) in a database table.
Everything works fine until the user gives a special sign f.e. a quote (')
in. What can I do to resolve this problem?
--
IntelYogi
6/2/2005 1:50:01 PM


[quoted text, click to view]
Mark Fitzpatrick
6/3/2005 10:05:06 AM
You need to actively search for these when the data is being submitted.
Before you submit it to the database you can replace a single ', with two
single quotes '' (note, this is not a double quote, but simply two single
quotes). The ' is a string terminator in SQL. Placing two together then
escapes the singlequote and lets SQL know that you are not terminating the
string but instead trying to input a singlequote.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

[quoted text, click to view]

AddThis Social Bookmark Button