Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Using Parameters's string checker? (no replies)

$
0
0
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!

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>