"There is already an open DataReader associated with this Connection ........"

  • Thread starter Thread starter NerulDude
  • Start date Start date
N

NerulDude

Hi All,

A stress test of the application i am currently working
on, popped up the following error with amazing regularity

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

I am trying to execute an "insert" SQL query using the
ExecuteNonQuery method of the command object.

This error comes up if i increase the number of users in
the application to 5 or more with a 5 sec think time.

Anything lower, the app works fine.

Does anyone have a clue as to what i might be doing wrong
here ?

I have ensured that all objects in the application are
explicitly disposed (or closed as the case may be) and set
to nothing.

thanks in advance
 
Can you post the code that's throwing the exception? The most likely
culprit is that somewhere a DataReader hasn't been closed but you would
expect the problem to happen regardless of users.
 
Back
Top