G
Guest
Hi All,
What is the good way to handle a string which contains characters like
single quote (') or square bracket with LIKE ([]), while building a SQL
statement. Right now iam searching these characters in the string and adding
the escape chars for that.
eg 1: (This will fail to search)
String* searchVal = S"Test'quote";
String* str = S"";
str = String::Format(S"Select * from t1 where c1 = '{0}'", searchVal);
eg 2: (so i need to add a extra ' in the string)
String* searchVal = S"Test''quote";
Any other solutions for this
Hari
What is the good way to handle a string which contains characters like
single quote (') or square bracket with LIKE ([]), while building a SQL
statement. Right now iam searching these characters in the string and adding
the escape chars for that.
eg 1: (This will fail to search)
String* searchVal = S"Test'quote";
String* str = S"";
str = String::Format(S"Select * from t1 where c1 = '{0}'", searchVal);
eg 2: (so i need to add a extra ' in the string)
String* searchVal = S"Test''quote";
Any other solutions for this
Hari