Data Reader Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,

I am using two datareaders with one connection and geting the following
error:

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

Should I use 2 connections with 2 separate datareaders.Or can I use 2
datareaders with one connection

Any help much appreciated.
 
As you can see by the error message, you cannot have 2 open data readers on
the same connection. So your options are to close the first before opening
the second, or to use 2 connections. Either that, or switch to using
datasets/datatables for one or both of your readers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top