problem with ExecuteStoreQuery RRS feed

  • Question

  •  I'm using ExecuteStoreQuery to return needed data for a grid to client via ria services,

    but the problem is when I run the load command on this Query it always gives me this error:

    Load operation failed for query 'getMyData'. The result of a query cannot be enumerated more than once.

    and it's the code of getMyData

    public IQueryable<myDataType> getMyData()
        return this.ObjectContext.ExecuteStoreQuery<myDataType>("My Really Complex Query In here")

    Any one has like this expreiance?

    Tuesday, July 13, 2010 5:24 AM


  • I believe if you add .ToList() to the end of your query you'll see this error go away.


    Tuesday, July 13, 2010 10:26 AM