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

Hi all,

Today i am getting a very interesting error.
When i try to start a process -which it works clearly for weeks- it getting this error.

Is there anyone who know how may i sove it?

image

1 Like

Hi @mazlumkacar,

Please have a look

This can happen if you execute a query while iterating over the results from another query. It is not clear from your example where this happens because the example is not complete.

One thing that can cause this is lazy loading triggered when iterating over the results of some query.

This can be easily solved by allowing MARS in your connection string. Add MultipleActiveResultSets=true to the provider part of your connection string (where Data Source, Initial Catalog, etc. are specified).

Source:

–
Mukesh

I did it but still getting this error

1 Like

Even I tried… Still same error…

Have you got solution for this error?

1 Like

Hi,

Try disconnecting and reconnecting to database before executing the query.
I faced the same error, basically I used couple of “Execute/run query” activities in my process.
Resolution: So what I did was after every Execute query activity I used disconnect to database activity and then connect to database activity and then Execute query activity.

Hope this helps you as well !!

1 Like

Did u get solution?