c# looping equivalent to EndOfField

  • Thread starter Thread starter .Net Sports
  • Start date Start date
N

.Net Sports

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
 
..Net Sports said:
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.
 
Back
Top