OleDbDataReader Question

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

    OleDbDataReader Question

    Hello,

    How do I get the number of row retrieved on a SELECT
    query when using OleDbDataReader ?

    I am using Framework 1.0.
  • Buddy

    #2
    Re: OleDbDataReader Question

    Hello,

    I was orginally using the OleDbDataAdapte r and then using
    the Fill method which provided me with the row count. The
    problem is that the DataSet uses DataTable underneath the
    cover which is not a lightweight object, we have a
    performance issue which is that the GC is constantly been
    run due to the Fill command (main cause is the dataset).
    We want to use the OleDbDataReader which is light weight
    but the only thing we cannot get out of it is the number
    of rows. I've noticed through the watch window it holds
    the number of rows in a variable called
    rowhandleNumber Rows but due to it protection level it
    cannot be access, this to be means a floor with Microsoft
    as they already know the number of rows.
    [color=blue]
    >-----Original Message-----
    >With Framework 1.0 no way to get it (Framework 1.1 has[/color]
    HasRows property but[color=blue]
    >won't tell the row number either) on beforehand. Bullet-[/color]
    proof way is to run[color=blue]
    >a separate query that returns the count or use DataSet.
    >
    >For what do you need the count? Perhaps there would be[/color]
    other approach to[color=blue]
    >solve your issue?
    >
    >--
    >Teemu Keiski
    >MCP, Designer/Developer
    >Mansoft tietotekniikka Oy
    >http://www.mansoft.fi
    >
    >AspInsiders Member, www.aspinsiders.com
    >ASP.NET Forums Moderator, www.asp.net
    >AspAlliance Columnist, www.aspalliance.com
    >
    >
    >"Buddy" <Buddy@Onlineho me.com> wrote in message
    >news:028b01c36 3e3$3e8f2380$a0 01280a@phx.gbl. ..[color=green]
    >> Hello,
    >>
    >> How do I get the number of row retrieved on a SELECT
    >> query when using OleDbDataReader ?
    >>
    >> I am using Framework 1.0.[/color]
    >
    >
    >.
    >[/color]

    Comment

    • Jared

      #3
      Re: OleDbDataReader Question

      use scalar to retreive count
      "Buddy" <Buddy@Onlineho me.com> wrote in message
      news:087601c363 ed$82a49910$a40 1280a@phx.gbl.. .[color=blue]
      > Hello,
      >
      > I was orginally using the OleDbDataAdapte r and then using
      > the Fill method which provided me with the row count. The
      > problem is that the DataSet uses DataTable underneath the
      > cover which is not a lightweight object, we have a
      > performance issue which is that the GC is constantly been
      > run due to the Fill command (main cause is the dataset).
      > We want to use the OleDbDataReader which is light weight
      > but the only thing we cannot get out of it is the number
      > of rows. I've noticed through the watch window it holds
      > the number of rows in a variable called
      > rowhandleNumber Rows but due to it protection level it
      > cannot be access, this to be means a floor with Microsoft
      > as they already know the number of rows.
      >[color=green]
      > >-----Original Message-----
      > >With Framework 1.0 no way to get it (Framework 1.1 has[/color]
      > HasRows property but[color=green]
      > >won't tell the row number either) on beforehand. Bullet-[/color]
      > proof way is to run[color=green]
      > >a separate query that returns the count or use DataSet.
      > >
      > >For what do you need the count? Perhaps there would be[/color]
      > other approach to[color=green]
      > >solve your issue?
      > >
      > >--
      > >Teemu Keiski
      > >MCP, Designer/Developer
      > >Mansoft tietotekniikka Oy
      > >http://www.mansoft.fi
      > >
      > >AspInsiders Member, www.aspinsiders.com
      > >ASP.NET Forums Moderator, www.asp.net
      > >AspAlliance Columnist, www.aspalliance.com
      > >
      > >
      > >"Buddy" <Buddy@Onlineho me.com> wrote in message
      > >news:028b01c36 3e3$3e8f2380$a0 01280a@phx.gbl. ..[color=darkred]
      > >> Hello,
      > >>
      > >> How do I get the number of row retrieved on a SELECT
      > >> query when using OleDbDataReader ?
      > >>
      > >> I am using Framework 1.0.[/color]
      > >
      > >
      > >.
      > >[/color][/color]


      Comment

      • Jeffrey Tan[MSFT]

        #4
        Re: OleDbDataReader Question


        Hi Budy,

        You can visit the link below to get some help:

        If you still have any concerns, please feel free to let me know.

        Jeffrey Tan
        Microsoft Online Partner Support
        Get Secure! - www.microsoft.com/security
        This posting is provided "as is" with no warranties and confers no rights.

        --------------------
        | Content-Class: urn:content-classes:message
        | From: "Buddy" <Buddy@Onlineho me.com>
        | Sender: "Buddy" <Buddy@Onlineho me.com>
        | References: <028b01c363e3$3 e8f2380$a001280 a@phx.gbl>
        <ODvWyf#YDHA.65 2@TK2MSFTNGP10. phx.gbl>
        <087601c363ed$8 2a49910$a401280 a@phx.gbl> <bhm1nd$shk$1@l s219.htnet.hr>
        | Subject: Re: OleDbDataReader Question
        | Date: Sat, 16 Aug 2003 23:39:00 -0700
        | Lines: 75
        | Message-ID: <050d01c3648a$3 e3a2bd0$a301280 a@phx.gbl>
        | MIME-Version: 1.0
        | Content-Type: text/plain;
        | charset="iso-8859-1"
        | Content-Transfer-Encoding: 7bit
        | X-Newsreader: Microsoft CDO for Windows 2000
        | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
        | Thread-Index: AcNkij438AdfHmR eR6a8xT2kzl2hcg ==
        | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
        | Path: cpmsftngxa06.ph x.gbl
        | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1769 65
        | NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
        | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
        |
        | I cannot use the ExecuteScalar method for two reasons,
        | one that I need all the data back, and second that I
        | cannot run the query twice as there are possible INSERT,
        | UPDATE, DELETE queries taking place.
        |
        | Any other ideas?
        |
        | >-----Original Message-----
        | >use scalar to retreive count
        | >"Buddy" <Buddy@Onlineho me.com> wrote in message
        | >news:087601c36 3ed$82a49910$a4 01280a@phx.gbl. ..
        | >> Hello,
        | >>
        | >> I was orginally using the OleDbDataAdapte r and then
        | using
        | >> the Fill method which provided me with the row count.
        | The
        | >> problem is that the DataSet uses DataTable underneath
        | the
        | >> cover which is not a lightweight object, we have a
        | >> performance issue which is that the GC is constantly
        | been
        | >> run due to the Fill command (main cause is the
        | dataset).
        | >> We want to use the OleDbDataReader which is light
        | weight
        | >> but the only thing we cannot get out of it is the
        | number
        | >> of rows. I've noticed through the watch window it holds
        | >> the number of rows in a variable called
        | >> rowhandleNumber Rows but due to it protection level it
        | >> cannot be access, this to be means a floor with
        | Microsoft
        | >> as they already know the number of rows.
        | >>
        | >> >-----Original Message-----
        | >> >With Framework 1.0 no way to get it (Framework 1.1 has
        | >> HasRows property but
        | >> >won't tell the row number either) on beforehand.
        | Bullet-
        | >> proof way is to run
        | >> >a separate query that returns the count or use
        | DataSet.
        | >> >
        | >> >For what do you need the count? Perhaps there would be
        | >> other approach to
        | >> >solve your issue?
        | >> >
        | >> >--
        | >> >Teemu Keiski
        | >> >MCP, Designer/Developer
        | >> >Mansoft tietotekniikka Oy
        | >> >http://www.mansoft.fi
        | >> >
        | >> >AspInsiders Member, www.aspinsiders.com
        | >> >ASP.NET Forums Moderator, www.asp.net
        | >> >AspAlliance Columnist, www.aspalliance.com
        | >> >
        | >> >
        | >> >"Buddy" <Buddy@Onlineho me.com> wrote in message
        | >> >news:028b01c36 3e3$3e8f2380$a0 01280a@phx.gbl. ..
        | >> >> Hello,
        | >> >>
        | >> >> How do I get the number of row retrieved on a SELECT
        | >> >> query when using OleDbDataReader ?
        | >> >>
        | >> >> I am using Framework 1.0.
        | >> >
        | >> >
        | >> >.
        | >> >
        | >
        | >
        | >.
        | >
        |

        Comment

        Working...