I'm using the OdbcDataReader object. If I'm querying a table called VOUCHER that has VENDOR_ID as the 4th colum which I could find out using
String fName = DbReader.GetName(i);
in a loop to find out the column number and then pull the data down with
_VendorID = DBReader.GetString(i) once I figure out that VENDOOR_ID is in column i,
Would there be a way to say somthing like
_VendorID = DBReader.GetString("VENDOR_ID") and have the class resolve the column name directly, or do I need to write a routine to do it? Seems like VBA does this with ADO, but this doesn't work they way I have tried to implement it.
Thanks.
Jeff

Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 11, 2008, 2:12 AM EST
dReader["columnname"].ToString();
or
dReader[columnindex].ToString();
Jeff Johnson34 reputationPosted Dec 11, 2008, 3:34 AM EST
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 11, 2008, 1:15 PM EST