【发布时间】:2011-02-28 23:42:37
【问题描述】:
我有以下代码,我想遍历此查询结果中的所有字段并填充名为字段的字典。
如果有数据阅读器,这可能吗?
OracleCommand command = connection.CreateCommand();
string sql = "Select * from MYTABLE where ID = " + id;
command.CommandText = sql;
Dictionary<string, string> fields = new Dictionary<string, string>();
OracleDataReader reader = command.ExecuteReader();
【问题讨论】:
标签: c# sql datareader