This is a migrated thread and some comments may be shown as answers.

Contains on the database server side currently not implemented

3 Answers 247 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Devanand Chahal
Top achievements
Rank 2
Devanand Chahal asked on 24 Jun 2009, 10:49 AM

Hi Thomas,

I am trying to use contains (equivalent to IN clouse in sql) to filter my data, I am using oracle as backend insted of Sql Server. See my code below:

string[] arrCode = new string[2]; 

arrCode[0] =

"AAA";    

 

arrCode[1] =

"BBA";  
 

var result = from c in scope.Secure<MtCurrency>()   

 

 

where (c.CurrencyCode.Matches(searchText) || c.CurrencyDescription.Matches(searchText)) && arrCode.Contains(c.CurrencyCode.ToString()) 

select c;

When I test this code in WebOrb, I got error: 
"Execution of 'System.Linq.Enumerable:Contains' on the database server side currently not implemented"

I am using Telerik OpenAccess ORM (version 08.13.2702) with visual studio 3.5 and oracle in backend.

Please suggest me where I am wrong ?
 
If I run this query without using contains then its working fine.

Regards,
Devanand Chahal    
CPA Global

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 25 Jun 2009, 04:01 PM
Hi Devanand Chahal,

This is an issue with the detection of the Enumerable:Contains. When you use
List<string> arrCode = new List<string>(new string[] { "AAA", "BBB" });
another method is used and this time it is detected correctly.

Kind regards,
Thomas
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Devanand Chahal
Top achievements
Rank 2
answered on 26 Jun 2009, 04:23 AM
Hi Thomas,
When I use list then I got another error. I have replaced string array with
 "List<string> arrCode = new List<string>(new string[] { "AAA", "BBB" });"  in my above said code
and got the below mentioned arror on runtime :

Execution of 'System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]:Contains' on the database server side currently not implemented


Please suggest me what could be the cause for this error.

Thanks,
D Chahal


0
Thomas
Telerik team
answered on 26 Jun 2009, 01:14 PM
Hi Devanand Chahal,

I'm sorry for this, but I guess my version is newer ... so this worked. That code should be in the latest public release (List<string>). Yesterday I corrected your original issue, so the next version will generate the right IN clauses. The next version is due in a few days (Q2 release).

Sorry for the confusing answer,
Thomas
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
LINQ (LINQ specific questions)
Asked by
Devanand Chahal
Top achievements
Rank 2
Answers by
Thomas
Telerik team
Devanand Chahal
Top achievements
Rank 2
Share this question
or