Reputation: 14753
Does anybody have any good .NET functions they can share to escape necessary MySQL query characters?
Thanks!
Upvotes: 0
Views: 964
Reputation: 3434
Could you give an example of the necessary characters? Without a context...you could try using "@" to give a literal string.
string query= @"select * from table"
Otherwise there is String.Replace()
.
Upvotes: 0
Reputation: 24177
Shouldn't you be using the MySQL Connector/NET? If you need to do something like parameterized queries, then it should provide "safe" and correct ways to do it, e.g. in this example.
Upvotes: 7