Parameter detected, but not found

5 posts, 2 answers
  1. Roman
    Roman avatar
    40 posts
    Member since:
    Jan 2009

    Posted 08 Jul 2009 Link to this post

    Hi

    I'm rather new to coding ASP.NET(C#), therefore I'd really appreciate some help for the following error:

    I get an error when when the second linq is executed:


    var protocolquery = from a in ScopeFactory.GetScope(ScopeID).Extent<Protocol>() 
                        select a; 
    var scprotocoltmp = from sc in protocolquery 
                        where sc.SectionProtocols.Contains(section) 
                        select sc; 
    if (scprotocoltmp.Count() > 0) 

    You can see it in the context in the images below.

    SectionProtocols is a collection of Protocol, containing multiple Sections. (That's why I use "Contains", to search the List).

    Thanks in advance for your help!
    Regards
    Deidn

    Screenshot links:

    http://yfrog.com/eqsiteij
    http://yfrog.com/5t95717762j
  2. Answer
    Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 15 Jul 2009 Link to this post

    Hi Roman,

    Could you try uniting both queries into one. The query should give you the desired result set if you alter it like the following:

    var protocolquery = from a in ScopeFactory.GetScope(ScopeID).Extent<Protocol>()  
                        where a.SectionProtocols.Contains(section)
                        select a;  


    Best wishes,
    Zoran
    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. Roman
    Roman avatar
    40 posts
    Member since:
    Jan 2009

    Posted 20 Jul 2009 Link to this post

    That's it, you're right!
    So does this mean that in case I use two queries I must somehow execute the previous IObjectScopeQuery before I'm able to further use it?

    Thanks alot for your solution!

    greetings
    Roman
  5. Answer
    Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 24 Jul 2009 Link to this post

    Hello Roman,

    It is preferable, but not always obligatory. You could split your query in two as well but the first should look like:
    var protocolquery = ScopeFactory.GetScope(ScopeID).Extent<Protocol>();  
    That way you could also execute the second query as you originally intended to.
    Once again, I would suggest you using one query instead of splitting it to two.

    Sincerely yours,
    Zoran
    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.
  6. Roman
    Roman avatar
    40 posts
    Member since:
    Jan 2009

    Posted 24 Jul 2009 Link to this post

    Ok great, good to know, thanks a lot!

    All the best
    Roman
Back to Top
DevCraft banner