用了下good_hy写的ORACLE分页存储过程,总是返回不了结果集
OracleConnection conn = new OracleConnection(OracleHelper.ConnectionString);
OracleCommand cmd = new OracleCommand();
cmd.CommandType = CommandType.StoredProcedure;
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "DotNet.DotNetPageRecordsCount ";
cmd.Parameters.Add( "SqlStr ", OracleType.VarChar).Value = Sql;
cmd.Parameters.Add( "TotalCount ", OracleType.Number).Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
TotalCount = int.Parse(cmd.Parameters[ "TotalCount "].Value.ToString());
cmd.Parameters.Clear();
cmd.CommandText = "DotNet.DotNetPagination ";
cmd.Parameters.Add( "CurrentPage ", OracleType.Number).Value = CurrentPage;
cmd.Parameters.Add( "SqlStr ", OracleType.VarChar).Value = Sql;
cmd.Parameters.Add( "PageSize ", OracleType.Number).Value = PageSize;
cmd.Parameters.Add( "PageCount ", OracleType.Number).Direction = ParameterDirection.Output;
cmd.Parameters.Add( "v_cur ", OracleType.Cursor).Direction = ParameterDirection.Output;
OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
PageCount = int.Parse(cmd.Parameters[ "PageCount "].Value.ToString());
return dr;
返回的dr没有结果行,那个存储过程我也没改什么 不知道为什么
------解决方案--------------------我的异常网推荐解决方案:oracle存储过程,http://www.aiyiweb.com/oracle-develop/177537.html
------解决方案--------------------把存储过程给COPY出来。。。
------解决方案--------------------