
Originally Posted by
pufa
As a "general" rule you should follow wwb99 advice...
"You should be using parameterized statements and let ADO handle cleaning up unwanted characters."
I've "bolded" his statement to enfase that you "should avoid using dynaminc sql statements" (and "should avoid using" should be read "do not use").
Any how for quick a "clean up" you can use the Regex.Escape(String) function.
"Escapes a minimal set of metacharacters (\, *, +, ?, |, {, [, (,), ^, $,.,#, and white space) by replacing them with their escape codes."
cheers,
Rui
Bookmarks