Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-02-2009
Member
 
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!
Reply With Quote
  #2  
Old 14-02-2009
Member
 
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
Reply With Quote
  #3  
Old 14-02-2009
Member
 
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!
Reply With Quote
  #4  
Old 14-02-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VB.NET Datareader to display number of rows?"
Thread Thread Starter Forum Replies Last Post
Dataset vs DataReader in .Net Vireshh Software Development 3 07-05-2011 11:32 AM
How to use datareader in VB.Net Jateen Software Development 5 13-03-2011 11:17 PM
Number of rows returned by SQL query odumitre Software Development 2 12-08-2009 05:11 PM
Merging duplicate names not rows copy rows into new workbook each time VBA Excel 2003 awkwardsmile Software Development 2 09-07-2009 08:57 AM
How do i automatically number rows in Excel 2007 Atilla Windows Software 3 21-04-2009 10:48 AM


All times are GMT +5.5. The time now is 05:15 PM.