Hi all,
I'm in the middle of a project where we are querying a database with more than 20 million records, applying several set of filters our query returns about 200 records (after waiting for about 1.30 minutes). After querying the database I try to create objects from this particular datareader but once every 15 or 16 records the asp.net process hangs (it hangs in the debugger) so I think it is a DataReader issue.
This is driving me crazy.
Here's the code I'm using
using (IDataReader reader = cmd.ExecuteReader())
{
List<Project> projects = new List<Project>();
while(reader.Read()) projects.Add(GetMappedRecord(reader));
}
private Project GetMappedRecord(DataRow reader)
{
Project project = new Project();
project.PropertyA = reader["FieldA"] as string;
// and so on and so forth...
return project;
}