Query over multipule tables to return Typed class

2 posts, 0 answers
  1. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 23 Apr 2011 Link to this post

    Dear All,

    I have a query that executes over three different tables and I need to return the result as an Entities.

    I started by creating a custom class to hold my result from the query

    Then I created an IQueryable method with the correct linq query to return the result.

    Here a sample of the method :
    public IQueryable<summaryview> Getsummery_View(int Status)
        var results = (from Summary in DataContext.summeries
            let details = Summary.parents.Where(o => o.id == Summary.id)
            join Period in DataContext.Periods on Summary.periodid equals Period.periodid
            where Summary.status == Status
            && Summary.Transdate >= Period.datef
            && Summary.Transdate <= Period.datet
        select new summaryview
            period = Summary.periodid,
            number = Summary.number,
            dnumber = Summary.dnumber,
            discriptor = Summary.discriptor,
            transdate = Summary.transdate,
            notes = Summary.notes
    return result;

    I complied & run the application, when I try to load the query I got an exception says:

    Part of the exception:
    Load operation failed for query 'Getsummery_View'. An exception occured during the execution of '
    Extent<RIAServicesORM.Web.summery>.Select(Summary => new <>f__AnonymousType0`2(Summary = Summary,

    What am I doing wrong, this was working fine with EF4.

    Any help !!
  2. Alexander
    Alexander avatar
    727 posts

    Posted 27 Apr 2011 Link to this post

    Hi Ubuntu,

    The exception you provided is unfortunately not very descriptive. Could you please debug again and look for an inner exception which could unveil additional details about the problem? You can also try to execute a simpler query, without the let and join statements and see if it works. If it does, this would mean that the problem is in the linq query itself, perhaps this is a case which is not supported by OpenAccess yet.

    All the best,
    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