How to prevent System.OutOfMemoryException when retrieving large amounts of data in c#
<p>I have a C# program that populates a dictionary with 4Million Guids at startup.
I keep getting an Exception of type 'System.OutOfMemoryException' error at this point.</p>

<p>Example:</p>

<pre><code>using (reportingconn)
{
    var initialrowkeys = reportingconn.Query("select rowkey from table”);
}
</code></pre>

<p>Can anyone give me some ideas how best to retrieve large amounts data from SQL into a dictionary?</p>
