reading from a datareader

Tomba

Member
Joined
Jul 22, 2003
Messages
17
hmm.. apparently I can only set a field ID when I want to retreive a value from a recordset.
I mean this:

Code:
while (dr.Read())
{
         this.cmbCity.Items.Add(dr.GetString(0));
}

that dr.GetString() cannot accept a field name instead of an integer. Is there any other function or way to reference a field by its name, instead of by its number?
 
Back
Top