当前位置:编程学习 > C#/ASP.NET >>

winform调用oracle存储过程问题

oracle存储过程在sql developer下测试过,执行没问题.
winform  下代码如下:
 int i_succeed;
using (OracleConnection con = new OracleConnection(ConfigurationManager.ConnectionStrings[station].ConnectionString))
            {
                con.Open();               
                OracleCommand cmd = con.CreateCommand();
                cmd.CommandText = "sp_sellreserve";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add("fromstation", OracleType.VarChar).Direction = ParameterDirection.Input;
                cmd.Parameters.Add("tostation", OracleType.VarChar).Direction = ParameterDirection.Input;
                cmd.Parameters.Add("fullpricecount", OracleType.Int32).Direction = ParameterDirection.Input;
                cmd.Parameters.Add("ov_resultint", OracleType.Int32).Direction = ParameterDirection.Output;

cmd.Parameters["fromstation"].Value = "1000";
cmd.Parameters["tostation"].Value = "1737";
cmd.Parameters["fullpricecount"].Value = 2;
cmd.ExecuteNonQuery();
i_succeed = Convert.ToInt32(cmd.Parameters["ov_resultint"].Value.ToString());
con.Close();
}
但执行到cmd.ExecuteNonQuery();程序便无法执行,请大师们指点一下,问题在哪? --------------------编程问答-------------------- 什么叫无法执行,错误提示是什么? --------------------编程问答-------------------- --------------------编程问答-------------------- 出现如上页面 --------------------编程问答-------------------- 你还是把发送错误报告给禁用吧,这个交给vs自己捕获即可,如果你的vs还是无法捕获错误,就直接重装vs或者重装系统。 --------------------编程问答-------------------- 先用try/catch捕获一下异常,看报错是什么,然后在具体解决
写可以在pl/sql端自己先测试一下你的存储过程,两头都要看
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,