none
Error :Entities does not recognize the method 'Boolean Contains(Int32) RRS feed

  • Question

  • HI ,

    I am getting error like :

     "LINQ to Entities does not recognize the method 'Boolean Contains(Int32)'
    method, and this method cannot be translated into a store expression.”

    while using the below code :

    List<int> evnt = evntSeq.ToList<int>();

    var output = from t in context.TRAN_DSCT_DET

                                     where t.RGSTR_I == tranDet.RegisterID && t.RGTN_I == tranDet.TransactionID && t.RGTN_START_TS == tranDet.StartTimeStamp && t.PRC_DSCT_TYPE_C == 26 && t.SLS_DSCT_DLR_A < 0 && !evnt.Contains<int>(t.EVNT_SEQ_I)                       

                                     select new { t.DSCT_DOC_I, t.EVNT_SEQ_I, t.SLS_DSCT_DLR_A };

    Please help on this.

    Regards

    Sandra


    Benarji Sandra-MS Dynamics CRM Developer

    Thursday, January 31, 2013 9:05 AM

Answers

  • The problem is that your query can't be translated to SQL because of "evnt.Contains<int> Contains<int> is unknown for SQL. try to use just Contains, without <int>

    Please Mark as Reply and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    • Marked as answer by Alexander Sun Thursday, February 7, 2013 6:52 AM
    Thursday, January 31, 2013 9:11 AM
  • What is the database type of the column t.EVNT_SEQ_I ?

    You really do not need to <int> after the Contains in the query.

      


    Fernando (MCSD)

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

    • Marked as answer by Alexander Sun Thursday, February 7, 2013 6:52 AM
    Thursday, January 31, 2013 4:39 PM

All replies

  • The problem is that your query can't be translated to SQL because of "evnt.Contains<int> Contains<int> is unknown for SQL. try to use just Contains, without <int>

    Please Mark as Reply and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    • Marked as answer by Alexander Sun Thursday, February 7, 2013 6:52 AM
    Thursday, January 31, 2013 9:11 AM
  • What is the database type of the column t.EVNT_SEQ_I ?

    You really do not need to <int> after the Contains in the query.

      


    Fernando (MCSD)

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

    • Marked as answer by Alexander Sun Thursday, February 7, 2013 6:52 AM
    Thursday, January 31, 2013 4:39 PM