来自ASP.NET 2的MySQL存储过程调用抛出Use Procedure实体异常

时间:2022-10-07 16:38:13

Hi I have the following scenario. I am calling stored procedures to MySQL 5.x from my .NET 2 application. All stored procedures have parameters and they work fine with the exception of two which throw the following exception (only when deployed to production):

嗨,我有以下情况。我从.NET 2应用程序调用存储过程到MySQL 5.x.所有存储过程都有参数,它们可以正常工作,除了两个抛出以下异常(仅在部署到生产时):

"When calling stored procedure and 'Use Procedure bodies' is false, all parameters must have their type explicitly set.

“当调用存储过程并且'使用过程主体'为假时,所有参数必须明确设置其类型。

This only occurs on the "production" environment. On my development machine, everything works fine in all cases.

这只发生在“生产”环境中。在我的开发机器上,所有情况下一切正常。

Any ideas? Thanks in advance, Tim

有任何想法吗?蒂姆,提前谢谢

2 个解决方案

#1


OK solved. I was passing DBNULL.Value as a parameter which it did not like apparently.

好的解决了。我传递DBNULL.Value作为一个它显然不喜欢的参数。

#2


The database account the application code is using may not have select permissions on mysql.proc. Provide the select permissions to the database account.

应用程序代码使用的数据库帐户可能没有mysql.proc的select权限。提供对数据库帐户的选择权限。

This blog post explains the reason in detail.

这篇博文详细解释了原因。

#1


OK solved. I was passing DBNULL.Value as a parameter which it did not like apparently.

好的解决了。我传递DBNULL.Value作为一个它显然不喜欢的参数。

#2


The database account the application code is using may not have select permissions on mysql.proc. Provide the select permissions to the database account.

应用程序代码使用的数据库帐户可能没有mysql.proc的select权限。提供对数据库帐户的选择权限。

This blog post explains the reason in detail.

这篇博文详细解释了原因。