IDataReader.GetName(i) 是否适用于空数据读取器?
我希望在空数据读取器的情况下输出具有空值的字段名称..即
产品:- Price: -
那么,当 IDataReader.GetName(i) 和 IDataReader.FieldCount 没有结果时,它们可以安全使用吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,我只是自己测试了这一点,针对空集执行了一个阅读器。 然后不调用 Read(); 当数据读取器有 0 行时,我成功地红色了所有列的 FieldCount 和 GetName(i)。
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.