首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

.net 操作Oracle 存储过程 OracleParameterCollection 只接受非空的 OracleParameter 类型对象。解决方案

2013-03-26 
.net 操作Oracle 存储过程 OracleParameterCollection 只接受非空的 OracleParameter 类型对象。C# codeusi

.net 操作Oracle 存储过程 OracleParameterCollection 只接受非空的 OracleParameter 类型对象。

C# code
using Oracle.DataAccess.Client;/// <summary>        /// Gets some t_points_alm3limitconfigs_new record dynamic for DataSet from the database according to the where and orderby conditions.        /// </summary>        /// <param name="whereCondition"></param>        /// <param name="orderByCondition"></param>        /// <returns></returns>        public DataSet getRecordsDynamicForDS(string whereCondition, string orderByCondition)        { OracleParameter[] parms = new OracleParameter[3];            if (string.IsNullOrEmpty(whereCondition) == true)            {                whereCondition = string.Empty;            }            if (string.IsNullOrEmpty(orderByCondition) == true)            {                orderByCondition = string.Empty;            }            parms[0] = new OracleParameter("a_WhereCondition", whereCondition);            parms[1] = new OracleParameter("a_OrderByExpression", orderByCondition);            parms[2] = new OracleParameter("c_Result", OracleDbType.RefCursor);            parms[2].Direction = ParameterDirection.Output;            DataSet ds = dal.ExecuteDataSet(CommandType.StoredProcedure, "TPRI.P_PT_ALM3LIMITCONFIG_SW", parms);            return ds;}

OracleParameter 引用的是 using Oracle.DataAccess.Client;这个命名空间下的
但是我dal.ExecuteDataSet()这个方法里面的连接是 
{System.Data.OracleClient.OracleConnection}
会不会是这个原因引起的

[解决办法]
dal.ExecuteDataSet 看起来像是企业库的。

你肯定是ExecuteDataSet(CommandType.StoredProcedure, "TPRI.P_PT_ALM3LIMITCONFIG_SW", parms);
的参数循序错误了。
我的异常网推荐解决方案:oracle存储过程,http://www.myexception.cn/oracle-develop/177537.html

热点排行