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.
 
Back
Top