Contains on the database server side currently not implemented

4 posts, 0 answers
  1. Devanand Chahal
    Devanand Chahal avatar
    26 posts
    Member since:
    Mar 2009

    Posted 24 Jun 2009 Link to this post

    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

  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 25 Jun 2009 Link to this post

    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.
  3. DevCraft banner
  4. Devanand Chahal
    Devanand Chahal avatar
    26 posts
    Member since:
    Mar 2009

    Posted 25 Jun 2009 Link to this post

    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


  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 26 Jun 2009 Link to this post

    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.
Back to Top