What's the recommended way of using to SqlDataReaders in a loop?

Discussion in 'ASP .Net' started by Rico Alexander, Oct 17, 2003.

  1. When the original has to be open to use its values as a parameter for the
    second reader? Is it still possible to use one Connection?
    Rico Alexander, Oct 17, 2003
    #1
    1. Advertising

  2. No. DataReaders cannot share a Connection.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "Rico Alexander" <> wrote in message
    news:...
    > When the original has to be open to use its values as a parameter for the
    > second reader? Is it still possible to use one Connection?
    >
    >
    Kevin Spencer, Oct 17, 2003
    #2
    1. Advertising

  3. Thanks, Kevin. I'll try replacing one with a dataset.
    "Kevin Spencer" <> wrote in message
    news:...
    > No. DataReaders cannot share a Connection.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > http://www.takempis.com
    > Big Things are made up of
    > Lots of Little Things.
    >
    > "Rico Alexander" <> wrote in message
    > news:...
    > > When the original has to be open to use its values as a parameter for

    the
    > > second reader? Is it still possible to use one Connection?
    > >
    > >

    >
    >
    Rico Alexander, Oct 17, 2003
    #3
  4. Rico Alexander

    William Ryan Guest

    Why don't you just use the first reader and load the variable(s) you need
    into an arraylist or similar structure. THen, close the reader. Open up
    the second one and you already have your value.
    "Rico Alexander" <> wrote in message
    news:...
    > Thanks, Kevin. I'll try replacing one with a dataset.
    > "Kevin Spencer" <> wrote in message
    > news:...
    > > No. DataReaders cannot share a Connection.
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft MVP
    > > .Net Developer
    > > http://www.takempis.com
    > > Big Things are made up of
    > > Lots of Little Things.
    > >
    > > "Rico Alexander" <> wrote in message
    > > news:...
    > > > When the original has to be open to use its values as a parameter for

    > the
    > > > second reader? Is it still possible to use one Connection?
    > > >
    > > >

    > >
    > >

    >
    >
    William Ryan, Oct 17, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Koch
    Replies:
    0
    Views:
    354
    Al Koch
    Jun 25, 2005
  2. Michele Simionato

    recommended way of generating HTML from Python

    Michele Simionato, Feb 20, 2005, in forum: Python
    Replies:
    13
    Views:
    584
    paul koelle
    Feb 22, 2005
  3. =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=

    question on sqldatareaders

    =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=, Aug 17, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    371
    =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=
    Aug 17, 2007
  4. Ian Kelly
    Replies:
    0
    Views:
    173
    Ian Kelly
    Oct 26, 2012
  5. Isaac Won
    Replies:
    9
    Views:
    371
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page