Adapter FetchTypedList

Posts   
 
    
nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 07-Feb-2008 20:57:47   

Error: Must declare the scalar variable @CustomerID

PredicateExpression filter = null; IRelationPredicateBucket bucket = new RelationPredicateBucket();

bucket.Relations.Add(Order.Relations.OrderID, JoinHint.Left); filter = new PredicateExpression(theField == strValue); DataTable dynamicList = new DataTable(); adapter.FetchTypedList(fields, dynamicList, bucket, 20, null, true, null);

Isn't this all that is required?

When just adding the join it works correctly, once I add the filter it complains about declaring the parameters...

With the adapter you don't need to do an parameterization do you?

What is wrong with this?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Feb-2008 09:54:57   

I don't think that's the real code. Would you please post the complete real code snippet?

nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 08-Feb-2008 14:53:29   

Well, I guess my only question is do you need to do any sql parameterization with the adapter fetchtypedlist. Can you provide a small example of using this call and creating a filter? I've looked in the documentation and it only uses a join in the dynamic list but says you may also include filters and aggregates.

Thanks

nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 08-Feb-2008 14:57:34   

By the way, when I look in the output window the SQL query is correct with the filter as a parameter. I also see the parameter in the output window of the correct datatype that was created. If I run the query generated and insert the parameter value in query analyzer it works fine. It just complains about declaring the parameter like it is not replacing the value with the parameter name in the query when running from the call FetchTypedList.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-Feb-2008 15:17:51   

Fetching a TypedList should be working fine, and there examples in the forums and in the LLBLGen Pro manual.

Answering the following questions will help us better diagnose the problem.

Would you please post the exact exception text and stack trace? Would you please post the complete real code snippet?

nada
User
Posts: 8
Joined: 07-Feb-2008
# Posted on: 08-Feb-2008 16:14:02   

I figured it out...thanks. I was changing the field alias when defining the fields to the entity.entityfield name rather than just leaving it as the entityfield.