I am trying to make this work but have been unlucky it is giving me th following error
Error in Like operator: the string pattern '%testing : | / - “ ‘ & * # @%' is invalid.
This search works as long as it doesnt contain a string as the one above.. This is my code for the search
DataRow[] rows = GetAllItems.Select("Name like '%" + cleanedText + "%'");
I tried - Modified per cHaos (still errors though)
string cleanedText = SearchText.Replace("\"", "\\\"").Replace("'", "''");
but no luck when i enter the following string in the search although i know it is in the data
testing : | / - “ ‘ & * # @%
Anyone has a nice suggestion
Thank you
sSearctText.Replace("\"", "\"")?.Replace("\"", "\"")does nothing useful, right? Same with all the other backslashed replacements -- you're replacing wacky chars with the exact same char. You probably want.Replace("\"", "\\\"")and the like.