1
我使用.NET连接器与MySQL 5.5。当我尝试调用存储过程与“出”的参数,我得到的消息OUT or INOUT argument 2 for routine
名is not a variable or NEW pseudo-variable in BEFORE trigger
在cmd.ExecuteNonQuery()
。如何将vb.net的输出参数传递给mysql存储过程?
出了什么问题?
VB代码:
cmd = New MySqlCommand("call testme(@id, @count)", conn)
cmd.Parameters.AddWithValue("@id", id) ' "id" and "count" are integer variables
cmd.Parameters.AddWithValue("@count", count)
cmd.Parameters("@count").Direction = ParameterDirection.Output
cmd.ExecuteNonQuery()
MySQL的存储过程:
CREATE PROCEDURE testme(in taxid integer, out imageDescCount integer)
BEGIN
set imageDescCount = 23;
End
打破了CMD。即使不更改存储过程和整数参数,类似这样的部件也可以解决问题。 (MySqlDbType.String生成一个错误,但将其更改为一个字符串变量工作正常。)谢谢! – xpda