Parameter 'p_out_rows' not found in the collection.

MichaelYnag 2012-09-20 03:26:30
用mysql 写了一个分页的存储过程,比较简单,保证没错,因为已经测试其正确与否。
在C#中调用该存储过程,报上面的错误。在网上查了几天帖子,没有一个清楚的解决思路。
查了mysql官网,说这个是2008年一版本中的bug。求达人指教!谢谢
C#调用的实例,如下

#region 存储过程参数设置
MySqlParameter tablenameparm = new MySqlParameter("p_table_name", MySqlDbType.VarChar);
tablenameparm.Direction = ParameterDirection.Input;
tablenameparm.Value = tableName;


MySqlParameter fildsparm = new MySqlParameter("p_fields", MySqlDbType.VarChar);
fildsparm.Direction = ParameterDirection.Input;
fildsparm.Value = filds;

MySqlParameter wherefield = new MySqlParameter("p_where_string", MySqlDbType.VarChar);
wherefield.Direction = ParameterDirection.Input;
wherefield.Value = strWhere;


MySqlParameter pageindexfield = new MySqlParameter("p_pageNo", MySqlDbType.Int32);
pageindexfield.Direction = ParameterDirection.Input;
pageindexfield.Value = pageIndex;


MySqlParameter perpageCnt = new MySqlParameter("p_perPageCnt", MySqlDbType.Int32);
perpageCnt.Direction = ParameterDirection.Input;
perpageCnt.Value = pageCount;



MySqlParameter porderparm = new MySqlParameter("p_order_string", MySqlDbType.VarChar);
porderparm.Direction = ParameterDirection.Input;
porderparm.Value = orderValue;

MySqlParameter recordtotalfield = new MySqlParameter("p_out_rows", MySqlDbType.Int64);
recordtotalfield.Direction = ParameterDirection.Output;
#endregion



MySqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.connString, CommandType.StoredProcedure, "PageSection",tablenameparm,fildsparm,wherefield,pageindexfield,perpageCnt,porderparm,recordtotalfield);
int result = SqlHelper.ExecuteNonQuery(SqlHelper.connString, CommandType.StoredProcedure, "PageSection",tablenameparm,fildsparm,wherefield,pageindexfield,perpageCnt,porderparm,recordtotalfield);
...全文
87 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
MichaelYnag 2012-09-21
  • 打赏
  • 举报
回复
问题已经解决

111,112

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧