Still relevant since 2012: I’m glad you’re one of the thousands who find this post helpful. If you enjoy this article, I’d love for you to stick around and check out some of my more recent writing on technology, leadership, strategy, and AI. Explore recent posts →

EntityCommandExecutionException

{"There is already an open DataReader associated with this Command which must be closed first."}

You get this error when your DataContext tries to retrieve a collection of objects from the database and then subsequently tries to write to an object in the same connection.

For 99% of the cases, you will be able to resolve this issue by wrapping your DataContext in a using block: