473,385 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

c# looping equivalent to EndOfField

when working with ASP, I was able to use control statement loops such
as "While myvar.EOF" , "Do Until myvar.EOF" , in which I would loop
thru a recordset until the particular field in a database table had
exhausted all its entries for that query.
I need to do something similar in C#, whereas I am reading data from a
datareader with
while(drMydatareader.Read())

will go thru the fields in the available data in a forward motion until
false (EndofFields), but I would like to specify what field I would
want to use as the parameter to test until there were no more entries
for that field.
Thanks in advance, netsports

Nov 17 '05 #1
1 1295
..Net Sports <ba********@cox.net> wrote:
when working with ASP, I was able to use control statement loops such
as "While myvar.EOF" , "Do Until myvar.EOF" , in which I would loop
thru a recordset until the particular field in a database table had
exhausted all its entries for that query.
I need to do something similar in C#, whereas I am reading data from a
datareader with
while(drMydatareader.Read())

will go thru the fields in the available data in a forward motion until
false (EndofFields), but I would like to specify what field I would
want to use as the parameter to test until there were no more entries
for that field.


It's not clear what you mean by a particular *field* having been
exhausted. You get a set of *rows* back from a database - what do you
mean by "no more entries for that field"? If you mean "no more entries
where that field is non-null" then you should specify the non-null
constraint in your query.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Lyle Fairfield | last post by:
The stored procedure script below is an example of how looping, case statements and output parameters can be used in MS-SQL stored procedures to accomplish things for which we may have had to use...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created during the beginning of an iteration and deleted at...
20
by: Stewart Graefner | last post by:
Here is a chunk of code that works for an individual record. It evaluates dates and checks or unchecks boxes as it goes along. It may not be pretty but it works. What my problem is that I need it...
2
by: John Dalberg | last post by:
In a traditional for loop, one can use the index (say i) and continue looping in another function and come back to original for loop (even though it's not good practice) Can the newer foreach...
14
by: John Salerno | last post by:
Here's an exercise I was doing to guess a number from 1-100. Just for fun (ha ha) I decided to add some error checking too, and now when I run it, the DOS prompt flashes real quick and disappears....
11
by: Jim Whitaker | last post by:
Expand full for viewing... I have a parent/child table. The basic setup is as follows: The parent table is called load sheet. It has fields such as Tripno, carrier, loaddate, etc. The child...
11
by: motion musso aka: sathia | last post by:
this is it, how can i get the current index? couldn't figure it out. thank you for(i=0;myarray.length<i;i++){ do_something(); //i need the current myarray } bye bye
11
by: Bosconian | last post by:
I'm trying to output the contents of an array of associative arrays in JavaScript. I'm looking for an equivalent of foreach in PHP. Example: var games = new Array(); var teams = new...
8
by: Tommy Grav | last post by:
I have a list: a = I want to loop over a and then loop over the elements in a that is to the right of the current element of the first loop In C this would be equivalent to:
20
by: Ifoel | last post by:
Hi all, Sorry im beginer in vb. I want making programm looping character or number. Just say i have numbers from 100 to 10000. just sample: Private Sub Timer1_Timer() if check1.value= 1...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.