Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Let's say I have record at table column is "Name"
This record is 'Ali is a Man'
What I'm trying
Dv.rowfilter= "Name like 'a%m%'"
I do it like SQL like clause but it fires exception EvaluateException
With message Error in like operator: the string pattern 'a%m%' is invalid
Any help ,please

What I have tried:

Dv.rowfilter= "Name like 'a%m%'"
Posted
Updated 6-Nov-18 4:20am

1 solution

Wildcard chars are allowed at begining or end or both but not the middle. The following would be allowed and would include your target row.
Dv.rowfilter="Name like '%a m%'"

Operator LIKE is used to include only values that match a pattern with wildcards. Wildcard character is * or %, it can be at the beginning of a pattern '*value', at the end 'value*', or at both '*value*'. Wildcard in the middle of a patern 'va*lue' is not allowed. From DataView RowFilter Syntax [C#][^]
 
Share this answer
 
v4
Comments
MS1995 6-Nov-18 15:15pm    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900