关于C#调用ORACLE PACKAGE 显示“对象不再存在”

因为调用该存储过程返回的不只一个游标,所以当出现该问题时我以为应该是多游标的问题,所以获取的READER应该是要NEXTRESULT一下才能到我需要的那个。

改用了下一下方法

         OracleConnection connection = new OracleConnection(connectionString);
                --连接
                connection.Open();
                OracleCommand command = new OracleCommand();
                command.Connection = connection;
                command.CommandText = "PACK_SIIT.getFlowTrack";--存储过程名
                command.CommandType = CommandType.StoredProcedure;--设置执行为存储过程
                command.Parameters.Add("var_barcode", OracleType.VarChar, 50);
                command.Parameters.Add("cur_FirstTrial", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters.Add("cur_Scan", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters.Add("cur_Send", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters.Add("cur_Receive", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters.Add("cur_Review", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters.Add("cur_Confirm", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters.Add("cur_Locked", OracleType.Cursor).Direction = ParameterDirection.Output;
                command.Parameters["var_barcode"].Value = stBarcode;// "DH448400001308120004CB1";
                OracleDataAdapter daReader = new OracleDataAdapter(command);
                DataSet ds = new DataSet();
                daReader.Fill(ds);
 
ds.tables.count
ds.tables[i]

这样去获取,后面还是持续的报那个错,找了下官网论坛,发现可能是临时表的一个设置问题

把临时表的创建选项由on commit delete rows改为on commit preserve rows

这样就OK了


posted @ 2011-10-24 09:28  lavandachen  阅读(477)  评论(0编辑  收藏  举报