SQLDataReader return 1 less row than actual

  • Thread starter Thread starter J Vallee
  • Start date Start date
J

J Vallee

Guest
Newbie here. Trying to learn.

I have written a successful query against a table with 21 records. 3 of the records have identical data in the column I'm selecting. (I have the table displayed on another monitor so I know the records exist).

However, when I do:

If (reader.Read())

and cycle thru the results with:

Console.WriteLine((reader["PrmtTNum"]));

but it always misses the first matching record.

It does give me the second and third record.

Any ideas on why it's skipping the first matching record?

Continue reading...
 
Back
Top