The syntax is correct, and filter expresion does work with strings, it is
likely that you have a logical error somehwere in the code that is creating a
different filter expression than you are expecting. Have you tried filtering
for strings by simply setting the complete FilterExpression property in one
line of code, rather than adding a where clause on at a later date. If that
works OK i would get your code to output the FilterExpresion property at
various points in the code so that you can track what is causing the problem.
"j.******@ahrc.ac.uk" wrote:
VS 2005
C#
ASP.NET
I have a Gridview which is filled from an objectdatasource. I have some
filtering - which works perfectly when the field to be filtered is an
INT.
dscIssues.FilterExpression += " and (assignedtoid = 1)" works ok
but if i filter on a string field is doesnt bring back any records
eg
dscIssues.FilterExpression += " and (name= 'tom')" fails
ive tried creating a FilterParamater as well, but it also fails