I have been having some issues with LINQ-To-SQL around memory usage. I\'m using it in a Windows Service to do some processing, and I\'m looping through a large amount of da
A DataContext tracks all the objects it ever fetched. It won't release this until it is garbage collected. Also, as it implements IDisposable, you must call Dispose or use the using statement.
This is the right way to go:
using(DataContext myDC = new DataContext)
{
// Do stuff
} //DataContext is disposed