Error :Entities does not recognize the method 'Boolean Contains(Int32)
-
Thursday, January 31, 2013 9:05 AM
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
All Replies
-
Thursday, January 31, 2013 9:11 AM
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 SunModerator Thursday, February 07, 2013 6:52 AM
-
Thursday, January 31, 2013 4:39 PM
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 SunModerator Thursday, February 07, 2013 6:52 AM

