How to deal with large result sets with Linq to Entities?

Posted by user169867 on Stack Overflow See other posts from Stack Overflow or by user169867
Published on 2010-06-16T17:39:19Z Indexed on 2010/06/16 17:42 UTC
Read the original article Hit count: 219

Filed under:
|
|

I have a fairly complex linq to entities query that I display on a website. It uses paging so I never pull down more than 50 records at a time for display.

But I also want to give the user the option to export the full results to Excel or some other file format.

My concern is that there could potentially be a large # of records all being loaded into memory at one time to do this.

Is there a way to process a linq result set 1 record at a time like you could w/ a datareader so only 1 record is really being kept in memory at a time?

I'd appreciate any help.

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ