Data Reader Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sunil Sabir

    Data Reader Error

    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.
  • Marina

    #2
    Re: Data Reader Error

    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.

    "Sunil Sabir" <SunilSabir@dis cussions.micros oft.com> wrote in message
    news:EFF6854F-D3AB-463B-9D0E-01F1F17CCB71@mi crosoft.com...[color=blue]
    > Dear All,
    >
    > I am using two datareaders with one connection and geting the[/color]
    following[color=blue]
    > error:
    >
    > "There is already an open DataReader associated with this Connection[/color]
    which[color=blue]
    > must be closed first"
    >
    > Should I use 2 connections with 2 separate datareaders.Or can I[/color]
    use 2[color=blue]
    > datareaders with one connection
    >
    > Any help much appreciated.[/color]


    Comment

    Working...