tags:

views:

162

answers:

1

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?

+1  A: 

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.

Konstantinos
+1 for trying it yourself!
TGnat