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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.