how can i loop through all of the columns of the OracleDataReader

Posted by ooo on Stack Overflow See other posts from Stack Overflow or by ooo
Published on 2010-06-08T03:00:34Z Indexed on 2010/06/08 3:02 UTC
Read the original article Hit count: 252

Filed under:
|
|

I have the following code and i want to loop through all the fields in the result of this query and populate the dictionary called field.

Given a datareader is this possible?

            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();

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql