View Linq to Entities Query RRS feed

  • Question

  • Microsoft JScript runtime error: Unhandled Error in Silverlight Application An error occurred while loading data through the 'GetAccountsViews' query on DomainContext of type 'AccountsDomainContext' and the error was not handled.  If this error is expected, then you must handle the LoadedData event on the DomainDataSource and call LoadedDataEventArgs.MarkErrorAsHandled() to avoid this exception.

    public IQueryable<AccountsView> GetAccountsViews(string accountNumber)
          AccountsEntities accountsContext = new AccountsEntities();
          return from account in accountsContext.Accounts
              join plan in accountsContext.Plans on account.PlanId equals plan.PlanId
              where account.AccountNumber.Equals(accountNumber)
              select new AccountsView { Name = account.Name, BusinessName = account.BusinessName, Discount = account.Discount, AccountNumber = account.AccountNumber, PlanName = plan.PlanName, PlanPrice = plan.PlanPrice };

    Thursday, August 25, 2011 6:23 AM

All replies

  • drowblade,

    You're using WCF Ria services I assume?  It's hard to know from that error what the problem might be.  It could be database access problems or any number of things.  

    To start with, go to your DomainService class and override OnError.  See if your code steps into this event:


    protected override void OnError(DomainServiceErrorInfo errorInfo)


    Tom Overton
    Friday, August 26, 2011 1:38 AM