PredicateFactory - comparing two columns

Posts   
 
    
Eddie1506
User
Posts: 9
Joined: 21-Nov-2007
# Posted on: 15-Apr-2009 12:50:03   

Hi, I have an old C# 1.1/Firebird 1.5 project that is still using LLBLGen Pro v 1.2005 latest build.

I need to filter some data in a TypedList with PredicateExpression (self servicing), but I need to compare two columns in that TypedList to not show if Column1 = Column2

Is there a way to achieve that? I was looking around the forum and haven't found a way to do it.

Thanks a lot!

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 15-Apr-2009 12:54:41   

You should use a FieldCompareExpressionPredicate.

e.g.

filter.Add(new FieldCompareExpressionPredicate(
    OrderFields.OrderDate, ComparisonOperator.NotEqual,
    new Expression(OrderFields.ShippedDate)));
Eddie1506
User
Posts: 9
Joined: 21-Nov-2007
# Posted on: 15-Apr-2009 13:20:07   

Thanks!

It works!