Page 1 of 1

OutOFMemoryException when querying entitymodel

Posted: Mon 15 Dec 2008 16:40
by vthh
Hi!
I have a EF model with Entities mapped to DB views, and the tables under the views are massive and when I try to query the these entities I get OutOfMemoryException. There must be something possible to fix this.

here is a snippet of the code

Code: Select all

using(ContractEntities ctx = new ContractEntities ())
{
List list = ctx.ContractSet.Where(p => p.SocialSecurityNumber == "1234567890").ToList();
return list;
}

Posted: Tue 16 Dec 2008 12:28
by AndreyR
When you work with ORM like Entity Framework you should be ready to the increasing of memory load.
Try to change your code obtaining the list of entities.

Posted: Thu 18 Dec 2008 17:28
by vthh
how so, use more filtering? well I've added more filtering and so far its not helping. This used to work perfectly but suddenly it just stoppes. are there any limitations to the trial version?

Posted: Fri 19 Dec 2008 13:42
by vthh
Found out what it was. I was passing a predicate of type Func to the execution method when instead it was supose to be Expression>. I wanted to use dynamic linq queries and thought that Func was the way to go :oops: