Dim badCharReplace As Regex = New Regex("([<>""'%;()&])")
Dim s As String = badCharReplace.Replace(psInput, "")
Saturday, March 31, 2012
text box editing
I have a text box where users can enter a reference number. This can be a varchar. I want to use this in a SQL lookup so I want to check for characters that may cause issues in the SQL statement . / _ % and such and escape them so they can still search by these fields? Any suggestions out there?You can use a regular expression to remove characters you don't want like so:
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment