Hi All,

I often get the same error when filling data adapter. There is already an
open DataReader associated with this Connection which must be closed first

myda.Fill(newds, "Employee")

But the same type fill command is working in other forms without error.

When filling data adapter it internally opens the executereader but it is
not closing.

How the OledbDataAdapter with fill works? When will it executes the reader.
Why there is a difference in filling with datasets?

Thanks in Advance
______________________________

S. Viswanathan

Re: DataReader and DataAdapter relation by Miha

Miha
Tue Jun 28 02:28:52 CDT 2005

Hi,

Perhaps some other DataReader uses the same connection at the same time?
Note that you have to Dispose DataReaders.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Viswanathan S" <visu@ewaksoft.com> wrote in message
news:uLmND36eFHA.1136@TK2MSFTNGP12.phx.gbl...
> Hi All,
>
> I often get the same error when filling data adapter. There is already an
> open DataReader associated with this Connection which must be closed first
>
> myda.Fill(newds, "Employee")
>
> But the same type fill command is working in other forms without error.
>
> When filling data adapter it internally opens the executereader but it is
> not closing.
>
> How the OledbDataAdapter with fill works? When will it executes the
> reader.
> Why there is a difference in filling with datasets?
>
> Thanks in Advance
> ______________________________
>
> S. Viswanathan
>
>