reader and number of column

  • Thread starter Thread starter Miliuccio
  • Start date Start date
M

Miliuccio

Can i not read with column NUMBER but by COLUMNNAME?

rdr.GetString(0)

but ?? rdr.GetString(NOMECOLONNA)??
 
You can either use the default indexer to retrieve the field value e.g.

rdr(NOMECOLONNA)

or use GetOrdinal method with the typed Get methods e.g.

rdr.GetString(rdr.GetOrdinal(NOMECOLONNA))

Peter
 
Back
Top