I have a dynamic query that returns around 590,000 records. It runs successfully the first time, but if I run it again, I keep getting a System.OutOfMemoryException
System.OutOfMemoryException
You're obviously not disposing of things.
Consider the "using" command when temporarily using objects that implement IDisposable.