isischen
asked on
I couldn't get the value of a column at a specific ordinal from a datareader.
Something worked for me the last time around --- myrow(mycold1) = autoreader.GetValue(2)
but now, it,autoreader.getvalue(2), only return the column name.
What I want is the content of the datareader's column returned from a datareader.read() method.
If I try to use datareader.getstring(2), I got a 'cast' exception.
but now, it,autoreader.getvalue(2),
What I want is the content of the datareader's column returned from a datareader.read() method.
If I try to use datareader.getstring(2), I got a 'cast' exception.
Using autoreader As System.Data.OleDb.OleDbDataReader = selectCmd.ExecuteReader()
autoreader.Read()
myrow = _DtText.NewRow()
myrow(mycol) = autoreader.GetValue(2)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
rachitkohli is correct. sorry, my answer is working only in VB.
autoreader.fields(0).value
Regards,
M.Raja