In my application I use string.Format() for the SQL like this
Dim strSQL As String = "SELECT X FROM MY_TABLE WHERE Y <> {0} AND Z = '{1}'"
strSQL = String.Format(strSQL, otherObj.Y, myObj.Z)
one day I did a global "stress" test using SQL injections (params with quotes, and stuff like this) and discovered a lot of bugs...
What is the best way in .NET to "fight" against it? Is there a String.Format or other common way to correctly(and safely) use the SQL parameters in sql queries.
With what would you'll recommend to replace String.Format
?