This is a migrated thread and some comments may be shown as answers.

Invalid LIKE Pattern

1 Answer 219 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 02 Aug 2011, 01:51 PM
Hi,
    When using the following Like pattern I get an error.
this.Filters.Add("=Fields.column1", Telerik.Reporting.Data.FilterOperator.Like, "%GRP:**All Admins**,%");

The error Invalid LIKE pattern %GRP:**All Admins**,%

If I remove the : and , from the string then no error is produced but of course no results are returned as : and , are in the column data in the DB. If I do this SQL syntax against the DB then it returns fine
SELECT * FROM mytable where Column1 like '%GRP:**All Admins**,%';

Is there anyway to format this so your like filter will accept it?
Thanks

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Aug 2011, 01:27 PM
Hi Paul,

The error is caused by the * character because wildcard characters are not allowed in the middle of a string. For example, 'te*xt' is not allowed. For your scenario our suggestion is to split the pattern in multiple filters.

Best wishes,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or