Recently I was creating a new Web Application using Entity Framework Code First principal. After a while I was getting the hang of it when I got an error message which I couldn’t place and had not seen before. It was of the type EntityCommandExecutionException and the Inner Exception said There is already an open DataReader associated with this Command which must be closed first.

I searched the internet for a solution and finally figured out it came from the connection string. I added MultipleActiveResultsets=True to my connection string and the error message was gone. Example: connectionString="Data Source={SQLServerUrl};InitialCatalog={Database}; Integrated Security=True;MultipleActiveResultsets=True"

The above addition to the connection strings makes it posisble for multiple connection te be open. This is used when you have multiple batches of changes and addition on the same connection.