Hi,
It would appear that when you use parameters, the connector will automatically format strings with escape characters in order to use quotes and semicolons, for instance, directly into your string. That way, I could solve a crash whenever someone tried to input some special characters into their name.
I was wondering if there was a way to use this function outside of parameters? Is there a way to feed the connector with a string (that would contain "reserved" parsing characters) so that it returns the "MySQL friendly" string?
Example:
string HasSemicolon foo = "Hello;world"
string EscapedString bar = EscapeThis(foo)
... INSERT INTO ... someField = EscapedString...
Thanks!
It would appear that when you use parameters, the connector will automatically format strings with escape characters in order to use quotes and semicolons, for instance, directly into your string. That way, I could solve a crash whenever someone tried to input some special characters into their name.
I was wondering if there was a way to use this function outside of parameters? Is there a way to feed the connector with a string (that would contain "reserved" parsing characters) so that it returns the "MySQL friendly" string?
Example:
string HasSemicolon foo = "Hello;world"
string EscapedString bar = EscapeThis(foo)
... INSERT INTO ... someField = EscapedString...
Thanks!