LLBLGen Typedview fetch gives parameters related gives error *

Posts   
 
    
sbalaji123
User
Posts: 26
Joined: 13-Oct-2006
# Posted on: 30-Jan-2007 13:52:04   

Original title: LLBLGen Typedview parameters giving error "The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100". -- Otis

Hi, I am using LLBLgen2.0 version in my web application & the mode is selfserving.

We have a method called getPrimaryMembers in our application.Whenever we call this method its throwing an error:

"The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100."

I have pasted the coding here.

public PeerGroupMembersViewTypedView getPrimaryMembers(string peerGroupId, string[] years) { PeerGroupPrimarySecondaryMembersViewTypedView objPrimary = null; PeerGroupMembersViewTypedView objPMembers = null; try { //Resetting the CommandTimeOut DbUtils.CommandTimeOut = CDMS.COMMON.StaticMembers.CommandTimeout;

            objPrimary = new PeerGroupPrimarySecondaryMembersViewTypedView();

            IPredicateExpression objFilterExp = new PredicateExpression();
            objFilterExp.Add(PeerGroupPrimarySecondaryMembersViewFields.PeerGroupId == peerGroupId);
            objFilterExp.AddWithAnd(PeerGroupPrimarySecondaryMembersViewFields.FlagPgmember == 1);
            objFilterExp.AddWithAnd(PeerGroupPrimarySecondaryMembersViewFields.Year == years);

            ISortExpression sortExp = new SortExpression(PeerGroupPrimarySecondaryMembersViewFields.EntityId | SortOperator.Ascending);

            objPrimary.Fill(0, sortExp, false, objFilterExp);

            objPMembers = new PeerGroupMembersViewTypedView();

            ArrayList objEntityId = new ArrayList();

            if (objPrimary.Rows.Count > 0)
            {
                for (int i = 0; i < objPrimary.Rows.Count; i++)
                    objEntityId.Add(objPrimary[i].EntityId);
            }
            else
                objEntityId.Add(null);


            objFilterExp = new PredicateExpression();
            objFilterExp.Add(PeerGroupMembersViewFields.EntityId == objEntityId);
            //objEntityId is the arraylist which have more than 3000 members..
            //for example 1,2,3....3000 like that


            sortExp = new SortExpression(PeerGroupMembersViewFields.EntityId | SortOperator.Ascending);

            objPMembers.Fill(0, sortExp, false, objFilterExp);
            //Here we get the error what we gave the title of this thread.

            return objPMembers;

        }
        catch (Exception ex)
        {
            CDMS.COMMON.ExceptionLog.Log.Error(ex.Message, ex);
            throw ex;
        }

Please suggest us how to avoid this error..

Thanks in advance, Bala

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 30-Jan-2007 18:23:38   

You use an arraylist with 3000 or so elements in a compare predicate which will result in a query with IN (@val1, @val2, ...., @val3000), though sqlserver can handle max 2100 parameters or so, so you can't do this.

Do you obtain these values from a table so you can perform a fieldcompareset predicate instead? Or are these values a sequence, so you could use a between predicate?

Frans Bouma | Lead developer LLBLGen Pro