I am using the .net connector with mysql 5.5. When I try to call a stored procedure with an “out” parameter, I get the message OUT or INOUT argument 2 for routine name is not a variable or NEW pseudo-variable in BEFORE trigger at cmd.ExecuteNonQuery().
What is wrong?
vb code:
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 stored procedure:
CREATE PROCEDURE testme(in taxid integer, out imageDescCount integer)
BEGIN
set imageDescCount = 23;
End
Please try this
Create Stored Procedure in MySQl like
And Your vb.net code like
Let me know if you have any problem…
Thanks