Re: Does anyone call stored procedure successfully in MS dotnet platform?
Hi Reggie,
Thanks for the input. I have upgraded my version of MySQL to 5.0.1 but am still receiving the same error. The exception is as follows:
MySql.Data.MySqlClient.MySqlException: Exception trying to retrieve parameter info for GetHardwareTypes: Invalid attempt to access a field before calling Read() ---> MySql.Data.MySqlClient.MySqlException: Invalid attempt to access a field before calling Read()
at MySql.Data.MySqlClient.StoredProcedure.GetParameterList(String spName)
at MySql.Data.MySqlClient.StoredProcedure.Prepare(String spName)
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.StoredProcedure.Prepare(String spName)
at MySql.Data.MySqlClient.MySqlCommand.PrepareSqlBuffers(String sql)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
For now I am going to use the text based method using the CALL command that I described earlier, as I need to move on with the development. I don't really recommend it as it's a bit of a fudge, but if anyone is in the same situation as me then it at least lets you continue until the cause of this error is found.
In regards to the problem Owen is having with parameters, it may be that you are missing some quotes. My code using parameters is:
MySqlCommand cmd = new MySqlCommand("CALL procedure('"value.ToString()+"')",mySqlConnection);
It's a bit hard to see here, but there is a ' character before and after the parameter value.
Brad.
Subject
Written By
Posted
November 15, 2004 06:52PM
November 16, 2004 11:42AM
November 17, 2004 03:19AM
November 17, 2004 09:49AM
November 17, 2004 07:42PM
November 18, 2004 09:27AM
November 18, 2004 10:47AM
November 18, 2004 11:45AM
Re: Does anyone call stored procedure successfully in MS dotnet platform?
November 18, 2004 09:49PM
November 21, 2004 01:27PM
November 22, 2004 12:10AM
November 22, 2004 10:36AM
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.