-
bindingsource.filter
Code:
AgencyId like '528%' and ResourceTypeId = '7'
I want to pass the above string as filter for the bindingsource but everytime it gives an error.
The error is :
Cannot perform 'Like' operation on System.Int16 and System.String.
Any help is highly awaited
-
Re: bindingsource.filter
The LIKE operator is only for text columns. As the error message says, it can't compare a Short and a String using LIKE.
-
Re: bindingsource.filter
I've never tried but you may well be able to do this:
Code:
CONVERT(AgencyId, 'System.String') LIKE '528%'
As the documentation for for the Filter property states, the legal syntax is detailed in the documentation for the DataColumn.Expression property.
-
Re: bindingsource.filter
Thanks to all replies
I have resolved the problem. Problem resolved but i do not know how to mark the thread as resolved. please help
-
Re: bindingsource.filter
Use the Thread Tools menu above the first post.
By the way, did you use the code I suggested?