Query with conversion not implimented?

2 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 06 Oct 2010 Link to this post

    var gsDirs = (from c in this.Context.GetItemCategories
                        where c.ItemID == itemid &&
                              c.ItemType == "Dictionary"
                        select c.ItemID).ToList();

    ItemID is a string, I need gsDirs to be a List<int>

    If I try and cast to int I get the

    Execution of 'System.Convert:ToInt32(String)' on the database server side currently not implemented.

    and a simple cast to (int) wont compile
  2. Petko_I
    Admin
    Petko_I avatar
    184 posts

    Posted 12 Oct 2010 Link to this post

    Hi Steve,

    The error you are receiving is exactly what you should be getting as the conversion really isn’t implemented on the server side now. However, we are currently changing our type converter system and will be able to facilitate server-side conversion in the future. For now, the in-memory conversion is a workaround to get the correct result set.

    var gsDirs = (from c in this.Context.GetItemCategories
                        where c.ItemID == itemid &&
                              c.ItemType == "Dictionary"
                        select c.ItemID).ToList();
    gsDirs = gsDirs.Select(x => Convert.ToInt32(x));

    Do not hesitate to contact us if you have further questions.

    Greetings,
    Petko_I
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top