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

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

  
What to do when receiving this kind of error :

There is already an open DataReader associated with this Command which must be closed first
How exactly are you getting this error?
I dont know why.It refers one query but if i delete that query i get the error on another query that exists on preparation
Hello, Filipe,

Are you still experiencing this issue?

We have encountered a pattern that might cause this error: if you have a query with Max. Records set to 1 and if you use the result of this query to iterate a For Each that runs over other queries, you might hit this error. The query that is shown in the error will be the one inside the For Each and not the one with the Max. Records set to 1.

You can workaround the problem by instead of using a For Each, access the results of the query directly (it only has one row anyway).

Let me know if this solves your issue.