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)を正常に赤くしました。