Update: See also this preexisting question, and its answers, of which this question is effectively a duplicate.
I'm using a 3rd-party API that takes a WHERE condition fragment of a SQL Statement
e.g. ThirdPartyFunction(where:"Category = 'abc'", top:5)
I have strings passed through a UI or web service and need to prevent against SQL injection attack.
Without the use of parameterized queries, and without an alternate method in the .NET framework to escape SQL strings (that I know of), I expect to manually escape the SQL string.
I have ideas about the best way to write an escape method but am looking for THE most secure solution.