"CoreLab.Oracle.OracleException" problem on oradirect mobile trial

"CoreLab.Oracle.OracleException" problem on oradirect mobile trial

Postby nasilyani » Tue 02 May 2006 09:41

Hi,
i downloaded oradirect mobile component and i am using it on .NET 2003 for establishing connection between ppc application and Oracle database.I want to run an oracle stored procedure from c# and i want to set input variables and get output variables of stored procedures. I changed corelab sample codes to do this. I created one oracle connection component and two oracle command components(for two stored procedures). when i run the application first i can establish connection to stored procedure and set the input variables but when i tried to that second time it gives an exception "CoreLab.Oracle.OracleException"
for "OracleCommand.ExecuteNonQuery();"
and the same exception is given for "OracleDataReader reader = oracleCommand1.ExecuteReader();" getting the output variables of stored procedure second time.
Is this a trial limitation or is there something wrong with my codes?
my codes:

Code: Select all
oracleConnection1.Open();
OracleParameter para = new OracleParameter("i_num",OracleDbType.Number);
        para.Direction = ParameterDirection.Input;
        para.Value = 2;
        OracleCommand.Parameters.Add(para);
        OracleParameter para2 = new OracleParameter("i_var",OracleDbType.VarChar);
        para2.Direction = ParameterDirection.Input;
        para2.Value = "b";
        OracleCommand.Parameters.Add(para2);
          OracleCommand.ExecuteNonQuery();


and

Code: Select all
oracleConnection1.Open();
OracleParameter para = oracleCommand1.Parameters.Add("i_num" , OracleDbType.Number);
        para.Direction = ParameterDirection.Output;
        OracleParameter para2 = oracleCommand1.Parameters.Add("i_var" , OracleDbType.VarChar);
        para2.Direction = ParameterDirection.Output;

        OracleDataReader reader = oracleCommand1.ExecuteReader();

        string n = oracleCommand1.Parameters["i_num"].Value.ToString();
        string v = oracleCommand1.Parameters["i_var"].Value.ToString();

        MessageBox.Show( n + v );

        reader.Close();


these are two different functions.
nasilyani
 
Posts: 1
Joined: Tue 02 May 2006 09:09
Location: Turkey

Postby Alexey » Wed 03 May 2006 11:14

Your code looks alright.
Please send us small test project if possible to reproduce the problem; include definition of your own database objects. Do not use third party components.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for Oracle