4

I want in the case of an empty data reader to output the field names with empty values.. ie

Product: - Price: -

So, are IDataReader.GetName(i) and IDataReader.FieldCount safe to use when they have no results?

Kostas Konstantinidis
  • 13,347
  • 10
  • 48
  • 61

1 Answers1

4

actually i just tested this my self, executing a reader against an empty set. Then without calling Read(); i successfully red the FieldCount, and GetName(i) for all columns while the data reader had 0 rows.

Kostas Konstantinidis
  • 13,347
  • 10
  • 48
  • 61