NotSupportedException: The method 'Join' is not supported.

I create a little c# expression with a join statement on a CRM database. I received the error:
NotSupportedException: The method 'Join' is not supported.

is this a CRM related error? I get the same error whether it is an expression, statement or program

Comments

  • Probably WCF OData related.

    Try using navigation properties if they exist or .AsEnumerable() to retrieve data sets separately and do the join locally.

    The latter will result in a lot more requests, more data being transferred and potentially lack of results due to late filtering and paging.

    Example navigation property:
    // http://services.odata.org/V3/Northwind/Northwind.svc
    from o in Orders
    select new { o.Customer.CompanyName, o.OrderDate }
    Request log:
    http://services.odata.org/V3/Northwind/Northwind.svc/Orders()?$expand=Customer&$select=Customer/CompanyName,OrderDate
    Example .AsEnumerable():
    // http://services.odata.org/V3/Northwind/Northwind.svc
    from o in Orders.AsEnumerable()
    join c in Customers.AsEnumerable() on o.CustomerID equals c.CustomerID
    select new { o.OrderDate, c.CompanyName }
    Request log:
    http://services.odata.org/V3/Northwind/Northwind.svc/Customers
    http://services.odata.org/V3/Northwind/Northwind.svc/Orders
    (due to max. 200 items fetched per request and no paging, the result is incomplete)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!