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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
rachitkohli is correct. sorry, my answer is working only in VB.
autoreader.fields(0).value
Regards,
M.Raja