Adapter - Doing an IN to a JOIN on Typed

Posts   
 
    
scottbed
User
Posts: 3
Joined: 16-Apr-2010
# Posted on: 16-Apr-2010 16:21:41   

Hi.....I meant self-service, not adapter.

I want to do something like this on a typedlist (self-service, not adapter).

Select ProductId from Product where ProductId in (select OrderItem.ProductId from OrderItem JOIN Order ON OrderItem.OrderID = Order.OrderId And Order.StatusId = 200)

Very confused...I am trying to use FieldCompareSetPredicate and a RelationCollection at some point.

I want to use PredicateExpression because I'm building the predicate a step at a time...the user has many fields they can enter search criteria. So for every field they enter I add to the predicate using the AddWithAnd method, like this:

if (_view.ProductIDTextBox.Text.Length > 0) predicate.AddWithAnd(new FieldLikePredicate(ProductFields.ProductId, _view.ProductIDTextBox.Text ));

if (_view.FirstNameTextBox.Text.Length > 0) predicate.AddWithAnd(new FieldLikePredicate(ProductFields.FirstName, "%" + _view.FirstNameTextBox.Text + "%"));

So I have to add another predicate for the select statement. Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Apr-2010 04:12:29   

You are correct, you need to use FieldCompareSetPredicate and a RelationCollection and a IPredicateExpression to build it. I don't understand where are you blocked out. Could you please paste the code you have so far?

David Elizondo | LLBLGen Support Team