If your data is in a SqlDataReader, then (assuming you're happy retrieving
the data as a single rowset using an key value):
While sdr.Read
'Read values from named columns in the data reader.
'Columns match the output cols from the SQL query.
yourIntValue = CInt(sdr("yourIntColumn"))
yourStringValue = CStr(sdr("yourVarcharColumn"))
End While
If your data is in a dataset (which can include all the source rows if you
need to), then:
private sub yourHandler()
dim yourDS as dataset
'... load the dataset...
'Access the row by number and the column by name...
yourIntValue =
Cint(yourDS.Tables("YourTableName").Rows(rowNumber).Item("yourIntColumn"))
'...Or you can use integer positions for both if you want, as demonstrated
for the string version.
yourStringValue =
CStr(yourDS.Tables("YourTableName").Rows(rowNumber).Item(columnNumber))
...
End Sub
Object indexes are always zero-based in dotnet, so first row is zero (0).
(That's from memory, so syntax might not be exact, but should be close
enough to point you in right direction)
Al