I have a new laptop at work and code that worked earlier in the week does not work today.
The code that worked before is, simplified:
while (dr.Read
are you checking for null ?
if(!dr.IsNull("FieldName")){ int i = Convert.ToInt32(dr["FieldName"])) }