Home All Groups Group Topic Archive Search About

Can't Fix Run-Time Error

Author
9 Jan 2007 5:32 AM
Jonathan Wood
Greetings,

Attached is part of a Web site I'm working on. (I've attached it to retain
formatting.) When it runs I get the following error on the line that says
ERROR HERE!:

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

I don't get this. I'm calling Close on my data reader each time through the
loop. How can this be corrected?

Thanks for any advice.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

[attached file: ErrCode.txt]

Author
9 Jan 2007 5:19 PM
Jonathan Wood
I figured this out. It has nothing to do with what the error message says.
Instead, it is the connection that must be closed first.

I fixed by creating a second connection and using that for the inner loop.
However, that doesn't seem very efficient. Would sure you love to see an
efficient example where data is read using a loop within a loop.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Show quote
"Jonathan Wood" <jw***@softcircuits.com> wrote in message
news:uqULD$6MHHA.4720@TK2MSFTNGP03.phx.gbl...
> Greetings,
>
> Attached is part of a Web site I'm working on. (I've attached it to retain
> formatting.) When it runs I get the following error on the line that says
> ERROR HERE!:
>
> "There is already an open DataReader associated with this Command which
> must be closed first."
>
> I don't get this. I'm calling Close on my data reader each time through
> the loop. How can this be corrected?
>
> Thanks for any advice.
>
> --
> Jonathan Wood
> SoftCircuits Programming
> http://www.softcircuits.com
>
>
>

AddThis Social Bookmark Button