How to GetDecimal from database by ColumnName (NOT: by column number) ?
- From: m.poppers@xxxxxxxxx (Mark Poppers)
- Date: 11 Jun 2007 11:33:37 GMT
Normally I retrieve an (e.g. DECIMAL) value from a database record by enumerating
the column number like:
Decimal localvar = reader.GetDecimal(3);
Which means "Get the decimal value from the 3rd column in the database record".
However is there a way to tell CSharp to retrieve the Decimal value from
the column named "MYAMOUNT" ?
I could imagine that it works similar to:
Decimal localvar = reader.GetDecimal(GetColumnNumberFor("MYAMOUNT"));
Marl
.
- Follow-Ups:
- Prev by Date: Re: this cf sender in event handlers
- Next by Date: Re: Can I download/re-install MS built-in Oracle data provider for VisualStudio ?
- Previous by thread: Can I download/re-install MS built-in Oracle data provider for VisualStudio ?
- Next by thread: Re: How to GetDecimal from database by ColumnName (NOT: by column number) ?
- Index(es):
Relevant Pages
|