Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I would like to know what is the C# equivalent to php
mysql_real_escape_string function. If there are no equivalent
funcitons, what functions in C# will help me attain the same results
as php mysql_real_escape_string function.
Posted

I have no idea what php does, but C# uses parameterised queries to make sure that your strings are properly formed. You should never build SQL with string mashing in C#.
 
Share this answer
 
I dont know if this is what you were looking for but adding to backslashes adds a single one.

For e.g. string strTemp = "\\";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900