Answers for "There is already an open DataReader associated with this Connection which must be closed first."

3

There is already an open DataReader associated with this Command which must be closed first c#

<connectionStrings>
    <add name="IdentityConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\IdentityDb.mdf;Integrated Security=True;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient" />
  </connectionStrings>
Posted by: Guest on February-26-2020
1

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

Add this to your connection string:
MultipleActiveResultSets=true;
Posted by: Guest on May-19-2021
0

c# datareader already open visual studio mysql

// Always, always, always put disposable objects inside of using statements:
using (Connection c = ...)
{
    using (DataReader dr = ...)
    {
        //Work with dr in here.
    }
}
//Now the connection and reader have been closed and disposed.
Posted by: Guest on February-01-2021
-1

There is already an open DataReader associated with this Connection which must be closed first.

there is already an open datareader associated with this command which must be closed.
Posted by: Guest on December-09-2020

Code answers related to "There is already an open DataReader associated with this Connection which must be closed first."

Browse Popular Code Answers by Language