I have here a "small" problem with a DataTable
.
From a SQL query I'm getting a huge amount of records (> 1,000,000 ), and although the query is relatively fast, loading DataTable
from Fill()
is extremely slow and, in some cases, it generates an error of System.OutOfMemoryException
because the process where the code is being executed exceeds the 4Gb (mandatory compile on x86).
My question is if there is any way to reduce the loading time of DataTable
and at the same time prevent memory from exceeding the limit.
Please note that this information will be used later for XML serialization.