p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning VB.NET Databases (http://p2p.wrox.com/forumdisplay.php?f=147)
-   -   Another problem... Chapter 5 (http://p2p.wrox.com/showthread.php?t=27110)

mmcdonal March 20th, 2005 05:24 PM

Another problem... Chapter 5
I typed in the following code according to the example on Page 104:

Dim objDataReader As OleDbDataReader
If objDataREader.HasRows Then

   I get an error on .HasRows: "'HasRows' in not a member of 'System.Data.OleDb.OleDbDataReader'."

   This is the second example in the book I can't get to work using the code as printed in the book.

Please help. Is there Errata? What can I check to fix this?


Thearon March 20th, 2005 07:00 PM

Another reader had a similar problem and was using Visual Studio 2002 as I expect you are. All of the code in the book was written using Visual Studio 2003.

However, to resolve this problem, all you need to do is to remove the If statement that checks the HasRows property of the DataReader.


mmcdonal March 20th, 2005 07:23 PM

I am indeed using Microsoft Development Environment 2002. I wil have to upgrade. I only have VB.Net installed. Can I upgrade just the VB, or do I need the entire studio?

Also, how would I remove the If statement? Just rem out all the lines between If...End If? Or remove the conditional part, and leave the While...End While? I believe it is the latter. I am assuming this is okay to do since we know that conditional for purposes of this example?


mmcdonal March 20th, 2005 07:26 PM

I remmed out the If line and the End If closing line, and it worked as advertised.

I will follow your upgrade advice when posted.

Thanks again for the help.


Thearon March 20th, 2005 07:37 PM


There's no need to upgrade as I believe that is possibly the only feature in the code that is not in Visual Studio 2002. If everything else is working fine as is then continue on with the exercises.

Of course if you want to upgrade then consult the Microsoft web site for the appropriate options at http://msdn.microsoft.com/vstudio/.


All times are GMT -4. The time now is 12:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.