Problem with FilterCompareExpressionPredicate

Posts   
 
    
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 16-May-2005 14:16:06   

Hi,

I want to query a typedview, where two fields doesn't equals, like the following SQL:

Select * from Orders where employeeID <> administratorID

dim bucket as new RelationPredicateBucket

bucket.PredicateExpression.add(new FieldCompareExpressionPredicate(entityFieldFactory.Create( _ MyTypedViewFieldIndex.EmployeeID), _ ComparisonOperator.NtEqual, _ New Expression(EntityFieldFactory.Create( _ MyTypedViewFieldIndex.AdministratorID))))

But I get the InvalidCastException error.

For the entire FieldCompareExpressionPredicate on writes in the debugger, th following error: "Cannot convert to Interface IEntityField".

Thanks

Gabor

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 16-May-2005 15:07:59   

change: MyTypedViewFieldIndex.EmployeeID), _ into: MyTypedViewFieldIndex.EmployeeID), Nothing, _

You're using the SelfServicing overload.

You can also use the PredicateFactory simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 16-May-2005 15:14:39   

Thanks, it works great!

Gabor