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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top