I am new to the .NET Entity Framework and am trying iterate over the records in a table with several million rows. Here is the basic code:
// select the records from the database
var records = from data in dataContext.Messages
select data;
// iterate over the messages
foreach (var record in records)
{
// do nothing
}
While iterating over the data I get an 'outofmemoryexception'. Is there some way that I can alter my query or manage the memory of the ObjectQuery instance?