Symmetri Developer Blog

June 16, 2008

FilterExpression LIKE wildcard doesn’t work?

.NET/C# - By Shourov Bhattacharya

Is it just me, or does the wildcard ‘%’ NOT work when setting the FilterExpression on an ObjectDataSource in .NET 2.0? Instead of the usual ‘%’ character, I have found that the asterisk ‘*’ is much more reliable. For example, the following statement returned no rows:

dsDocuments.FilterExpression = 'title LIKE '%Engineering%'

but this DID work:

dsDocuments.FilterExpression = 'title LIKE '*Engineering*'

MSDN documentation says that both forms are equivalent, but apparently not, at least in my experience.

Comments »

No comments yet.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph