Link to home
Start Free TrialLog in
Avatar of José Perez
José PerezFlag for Chile

asked on

C# / ORACLE/ODP query Select * from v$version

Hi,
after a succesful connection to the database I want to run the query "Select * from v$version where banner like '%Oracle'"

how can I display the result in a multiline Textbox? (This is the part I am having the issue, it displays nothing)

This the code I have:

                conn.Open();

                string strSQL = "select * from v$version WHERE banner LIKE '%Oracle'";
                OracleCommand cmd = new OracleCommand(strSQL, conn);
                OracleDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    reader.GetString(0);
                    txtQuery.Text = reader;
                }

                conn.Close();
                conn.Dispose();
                conn = null;
                
            }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of José Perez

ASKER

Excellent!