RecordCount of a datareader

Discussion in 'ASP .Net' started by Steve Caliendo, Jun 2, 2004.

  1. Hi,

    I can't seem to figure out how to determine the number of records are
    returned when using a DataReader. I use:

    While Rs1.Read
    some stuff
    end while

    But what I'd really like to know is Rs1.RecordCount which doesn't exist. Or
    does it in some other syntax?

    Steve
     
    Steve Caliendo, Jun 2, 2004
    #1
    1. Advertising

  2. Steve Caliendo

    John Oakes Guest

    The DataReader is readonly forward-only. It doesn't know the number of
    records returned. Depending on what you are trying to do, you can use a
    dataset instead, count the number of records, return a parameter with the
    number of records, etc.

    -John Oakes


    "Steve Caliendo" <> wrote in message
    news:...
    > Hi,
    >
    > I can't seem to figure out how to determine the number of records are
    > returned when using a DataReader. I use:
    >
    > While Rs1.Read
    > some stuff
    > end while
    >
    > But what I'd really like to know is Rs1.RecordCount which doesn't exist.

    Or
    > does it in some other syntax?
    >
    > Steve
    >
    >
     
    John Oakes, Jun 2, 2004
    #2
    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. Daan
    Replies:
    4
    Views:
    15,610
    chris22smith
    Mar 18, 2009
  2. Replies:
    2
    Views:
    2,861
    Peter Rilling
    Oct 13, 2005
  3. =?Utf-8?B?UGF1bA==?=

    DataReader and RecordCount

    =?Utf-8?B?UGF1bA==?=, Oct 21, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    38,032
    Patrick.O.Ige
    Oct 22, 2005
  4. =?Utf-8?B?YmVybmFkb3U=?=

    datasource.recordcount? How to obtain this?

    =?Utf-8?B?YmVybmFkb3U=?=, Feb 9, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    3,520
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Feb 9, 2006
  5. Rpng123
    Replies:
    3
    Views:
    7,876
    Rpng123
    Dec 4, 2003
Loading...

Share This Page