I am trying to loop through the fields in a datareader so that i can read the data into an array. It works the first time around i.e the first column, but when i=1 a get an "Object reference not set to an instance of an object" error. Please tell me what i am doing wrong!
heres the code:
If rdr.HasRows Then
rdr.Read()
For i = 0 To rdr.FieldCount
arrValues(i) = CStr(rdr.Item(i ))
Next
End If
heres the code:
If rdr.HasRows Then
rdr.Read()
For i = 0 To rdr.FieldCount
arrValues(i) = CStr(rdr.Item(i ))
Next
End If
Comment