Today I was getting following error when running one of our applications:
There is already an open DataReader associated with this Command which must be closed first.
This happens when you have multiple DataReader
s open on the same connection. Note that this can also be because you’re iterating through LINQ query results, which internally also use DataReader
s.
To solve this (on SQL Server 2005 + .NET 2.0 or later) add MultipleActiveResults=True
to your connection string.