It appears that SqlDataReader reads ahead
while (rdrMainLoop.Read())
{
sID = rdrMainLoop.GetInt32(0);
nearDupID = rdrMainLoop.IsDBNull(2) ? 0 : rdrMainLoop.GetInt32(2);
sqlCmdProducer.CommandText = "update [docSVsys] set [FTSnearDupID] = '" + sID.ToString() + "' where [sID] = '" + (sID + 1).ToString() + "';";
sqlCmdProducer.ExecuteNonQuery();
}
In this example I am updating the next line.
But when I .Read() the next line SqlDataReader does not read the current value.
I assume it batches ahead for speed.
Is there a way to force SqlDataReader to read one line at a time.
I am good with a dirty read (has to be as I may update that line).