Results 1 to 4 of 4

Thread: VB.NET Datareader to display number of rows?

  1. #1
    Join Date
    Feb 2009
    Posts
    7

    VB.NET Datareader to display number of rows?

    Hi,
    I want the dataReader to display the number of rows,
    Is this possible in Vb.Net?
    Thanks for the help!

  2. #2
    Join Date
    Feb 2009
    Posts
    10

    Re: VB.NET Datareader to display number of rows?

    Hi,
    I tried for this but with following code I get no. of columns not the rows.

    Code:
    m_cnt = m_drd.getSchemaTable.rows.count

  3. #3
    Join Date
    Jan 2009
    Posts
    36

    Re: VB.NET Datareader to display number of rows?

    Please visit this webpage.

    http://www.devx.com/vb2themax/Tip/18807

    I hope this helps!

  4. #4
    Join Date
    Jan 2009
    Posts
    38

    Re: VB.NET Datareader to display number of rows?

    A DataReader should be used wherever you need forward-only, read-only access to the data, regardless of how much there is. If you need to make updates to the data and send it back to the database then a DataAdapter is the appropriate choice, but if you just need to get each row, use its data and discard it then a DataReader is the way to go. To answer the original question (again), the DataReader doesn't know how many rows there are ubtil it's read them, so you can't know how many rows there are until you've finished using the DataReader. A DataAdapter can tell you how many rows there are because it has already retrieved them all when Fill returns.

Similar Threads

  1. Dataset vs DataReader in .Net
    By Vireshh in forum Software Development
    Replies: 3
    Last Post: 07-05-2011, 11:32 AM
  2. How to use datareader in VB.Net
    By Jateen in forum Software Development
    Replies: 5
    Last Post: 13-03-2011, 11:17 PM
  3. Number of rows returned by SQL query
    By odumitre in forum Software Development
    Replies: 2
    Last Post: 12-08-2009, 05:11 PM
  4. Replies: 2
    Last Post: 09-07-2009, 08:57 AM
  5. How do i automatically number rows in Excel 2007
    By Atilla in forum Windows Software
    Replies: 3
    Last Post: 21-04-2009, 10:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,721,859,735.30206 seconds with 17 queries