I am in process of writing a program in c# where I need to extract records from tables. When the table has more the 1million recordsm, my query throws OutOfMemory exception. To overcome this, I modified my query to :