Re: Does anyone call stored procedure successfully in MS dotnet platform?
Posted by: Brad Howlett
Date: November 18, 2004 09:27AM

Here's a questionable fix if you're having trouble getting stored procedures to work using MySqlCommand. As none of the example code in the documentation showed the use of stored procedures, I assumed that the syntax should be the same as if using an SqlCommand (which was confirmed by another thread on this forum), but was unable to get this to work. I have worked around this by setting the CommandType to Text (it's the default) and initialising the command as (in C#):

MySqlCommand cmd = new MySqlCommand("CALL procedure()",mySqlConnection);

Obviously this becomes slightly more complicated when parameters are required, as they have to be added to the query string, but it's the best solution I've come up with that works.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.