3
Reply

Direct lookup of field?

Jeff Johnson

Jeff Johnson

Dec 10 2008 11:54 PM
3.1k

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


Answers (3)
Next Recommended Forum