Query problem

Posts   
 
    
mrge
User
Posts: 1
Joined: 12-Jan-2007
# Posted on: 12-Jan-2007 18:40:31   

I am newcomer in LLBLGen and my question is i have little strange sql query and can not implement PredicateExpression. So my question is if I have sql query like this:

Select * from table where ((Field_A LIKE 'param') OR (Field_B LIKE 'param2'))  

what PredicateExpression will be?

Thanks, Dee

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 13-Jan-2007 02:51:00   

Select * from table where ((Field_A LIKE 'param') OR (Field_B LIKE 'param2'))

I'm going to assume LLBLGen 2.0 and C#.


IPredicateExpression filter = new PredicateExpression();
filter.Add(TableFields.FieldA % "param");
filter.AddWithOr(TableFields.FieldB % "param2");

If this doesn't work for creating the predicate expression please post the code that you are attempting along with your setup.