Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do you use a DataReader in a if statement without

Reply
Thread Tools

How do you use a DataReader in a if statement without

 
 
Rico Alexander
Guest
Posts: n/a
 
      10-16-2003
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.


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      10-17-2003
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.

"Rico Alexander" <> wrote in message
news:...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot use "fill" with Datareader .Net Sports ASP .Net 5 08-29-2005 04:36 PM
How to use a value of a datareader? Shapper ASP .Net 4 06-03-2005 01:43 PM
How to use a datareader instead of a dataset? Shapper ASP .Net 2 04-25-2005 02:43 PM
DataSet versus DataReader. Which one to use? Thank You. Shapper ASP .Net 2 04-22-2005 12:29 AM
Should I use only one public DataReader, or multiple? Andrei Pociu ASP .Net 2 10-17-2004 12:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57