I am trying to fulfill a few oracle selection requests, how to explain in response to this post here , but I get an exception as shown in the image
the same thing is explained on oracle site here
Does btw still process strings found from one of these queries?
string cmdstr = @"begin open :1 for SELECT a.column1, a.olumn2 b.column3 FROM table1 A,table2 B WHERE A.column1=B.column1 AND A.column2 = NVL(:P_para, 0) AND B.column3='1'; open :2 for select column1, column2, column3, From dual; end;"; using (OracleConnection conn = new OracleConnection(connstr)) using (OracleCommand cmd = new OracleCommand(cmdstr, conn)) { try { cmd.Parameters.Add(new OracleParameter(":P_para", OracleDbType.Int64)).Value = Convert.ToInt64(Textbox.Text); cmd.Parameters.Add("p_cr1", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output); cmd.Parameters.Add("p_cr2", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output); cmd.CommandText = cmdstr; conn.Open(); OracleTransaction trans = conn.BeginTransaction(); OracleDataReader oraReder; oraReder = cmd.ExecuteReader(); while (oraReder.Read()) { textbox1.Text = oraReder.GetString(0).ToString(); textbox2.Text = oraReder.GetValue(1).ToString(); textbox3.Text = oraReder.GetValue(2).ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Erorr Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
sam Dec 23 '16 at 18:37 2016-12-23 18:37
source share