SqlDataReader

  • Thread starter Thread starter SC
  • Start date Start date
S

SC

Hi,

After a SqlDataReader.ExecuteReader method has returned,
how can I get the field names of every column that were
returned?

It has to be possible, right? I looked through the
different methods and properties but I couldn't find
anything. Maybe I missed it!

Thanks a lot,

SC
 
SC said:
After a SqlDataReader.ExecuteReader method has returned,
how can I get the field names of every column that were
returned?

Use SqlDataReader.FieldCount to get how many fields there are (in the
current row) and then SqlDataReader.GetName(int) to find the name for
any particular column.
 
Hi SC,

There is FieldCount (count of columns) and GetName() method which returns
column name.
Is this you were after?
 
Back
Top