• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C#中调用mysql存储过程出现的问题

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

在root账号中,可以正常调用存储过程.

换到common_user账号时,同一存储过程名调用出现问题.

追踪调试时出现:

搜索解决方案:

关键语句是:


在网上搜索本句含义:

Name : Use Procedure Bodies 
Default : true 
Description : Setting this option to false indicates that the user connecting to the database does not have the SELECT privileges for the mysql.proc (stored procedures) table. When to set to false, Connector/NET will not rely on this information being available when the procedure is called. Because Connector/NET will be unable to determine this information, you should explicitly set the types of the all the parameters before the call and the parameters should be added to the command in the exact same order as they appear in the procedure definition. This option was added in Connector/NET 5.0.4 and Connector/NET 1.0.10. 

 大体意思是说:

当设置时use procedure bodies=false,存储过程的参数需要与程序里的参数顺序一致.

还未结束.

在mysql官方.给出了这样设置会有一个BUG.

http://bugs.mysql.com/bug.php?id=36694

当然这样解决的办法还是有的.可以使用ODBC连接来实现.

这里不再详细说明.

附上.NET连接mysql的连接字符串网址(比较全面的连接归类):

http://www.connectionstrings.com/mysql


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C#跨线程调用 发布时间:2022-07-10
下一篇:
c#winform加载窗体自动最大化,非全屏,不会遮盖任务栏发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap