none
Maximum limit of Where clause in Linq? RRS feed

  • Question

  • Hi,

     Currently I am using Linq to SQL query in silverlight

    dbQuery = dbQuery.Where(szQuery, lstQuery.ToArray());

    szQuery looks like

    "RECID==(@0) or RECID==(@1) or RECID==(@2) or RECID==(@3) or RECID==(@4) or RECID==(@5) or RECID==(@6) or RECID==(@7) or RECID==(@8) or RECID==(@9) or RECID==(@10) or RECID==(@11) or RECID==(@12) or RECID==(@13) or RECID==(@14)"

    and lstQuery contains 15 IDs of string type

    after executing above where dbQuery looks like

    {http://localhost:8080/testservice.svc/testtbl()?$filter=((((((((((((((RECID eq '802000010410P0001') or (RECID eq '802000010411P0001')) or (RECID eq '802000014350P0001')) or (RECID eq '802000016931P0001')) or (RECID eq 'A055265P0001')) or (RECID eq 'A055267P0001')) or (RECID eq 'A105919P0001')) or (RECID eq 'A319436P0001')) or (RECID eq 'A320918P0001')) or (RECID eq 'A378885P0001')) or (RECID eq 'A384976P0001')) or (RECID eq 'A384982P0001')) or (RECID eq 'A387837P0001')) or (RECID eq 'A415742P0001')) or (RECID eq 'A421831P0001')}

    when I call dsQry.EndExecute(c);


    "DataServiceQueryException unhandled by usercode."

    when I try with a list contains 14 IDs then works fine, the moment I try with above 14 IDs then showing above exception.

    Any Limit in the where clause in linq which restricts the number of clause?

    Any help will be highly appreciated.

    Thanks,
    Raj

    Tuesday, March 27, 2012 10:51 AM

Answers

  • Hi Raj;

    I believe your issue is not being caused by Linq to SQL and my be caused by WCF if in fact you are using WCF. If you are can you post your question to the following forum:

    WCF Data Services

    Thanks;

    Fernando 



    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, March 28, 2012 2:41 PM

All replies

  •  

    Can you post the inner exception when it is thrown.

     


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, March 27, 2012 3:12 PM
  • Hi,

        Below is the complete image of innerexception

    "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\r\n<error xmlns=\"\r\n">http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <code></code>\r\n  <message xml:lang=\"en-US\">Recursion reached allowed limit.</message>\r\n</error>"

    Wednesday, March 28, 2012 6:49 AM
  • Hi Raj;

    I believe your issue is not being caused by Linq to SQL and my be caused by WCF if in fact you are using WCF. If you are can you post your question to the following forum:

    WCF Data Services

    Thanks;

    Fernando 



    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, March 28, 2012 2:41 PM