How do you use a DataReader in a if statement without

  • Thread starter Thread starter Rico Alexander
  • Start date Start date
R

Rico Alexander

advancing the record its reading. I'm trying to use a Do While Read() after
a If Dataread statement but its not reading all the records.
 
You can't. What you can do is something like the following:

If objDataReader.Read() Then
Do
' some code
While objDataReader.Read()

This advances the DataReader to the first record initially, but performs no
operation with it. The loop advances the DataReader AFTER performing
operations on the current record.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
Back
Top