If I filter a BindingSource's column like this: "column1 LIKE '%John%'"
, then all rows containing John on that column will return.
How to return all rows for which column1 contains [some text]John[some text]Doe
?
"column1 LIKE '%John%Doe'"
does not work.
try this
Per the documentation at http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx
Therefore, you can't use LIKE to do what you want. Your next best bet is to get the string representation and use a Regex to parse it looking for the text you want. That's going to be SLOW.
You COULD do
but the logic is different and may not be what you really want.
Edit - added
You might be better off doing the filtering at the server level, as your DB might support a wildcard in the middle of the string. I just tried it on our SQL Server and it works fine. (SQL Server 2005)