Background
I have a database table that contains a large amount of records, 500 thousand. I use to load them all at once and binding them to a GridView. Obviously the page loading time is adversely affected by this.
My solution
I thought I could use the Lazy Loading feature of Entity Framework to only load sections of my data that were in view/ being displayed by the gridview. So I implemented a EF solution, but I now get a system.OutOfMemoryException.
After some reading it turns out EF loading all the records twice, which is why I'm obviously running out of memory.
Question
Is EF the right solution for lazy loading large amounts of data? If so how do I go about it?