Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望在空数据读取器的情况下输出具有空值的字段名称..即
产品:- 价格:-
那么,当 IDataReader.GetName(i) 和 IDataReader.FieldCount 没有结果时可以安全使用吗?
实际上我只是测试了我自己,对一个空集执行一个阅读器。然后不调用 Read(); 当数据读取器有 0 行时,我成功地为所有列添加了 FieldCount 和 GetName(i)。