I am calling a MySQL stored procedures using a MySQlCommand object with named parameters. My understanding is that this is supposed to allow me to disregard the order of the parameters in the stored procedure. However, it doesn't appear to be working that way. If I switch the order of the parameters in the stored procedure (which shouldn't affect anything) the values of the columns get switched.
Am I missing something here, or is this a problem with the library?
Calling stored procedures
Retrieving stored procedure parameters information requires a roundtrip to server. Thus command parameters (in case when ParameterCheck=true and CommandType=CommandType.StoredProcedure) are updated only on Prepare() or Execute*() call.
Please follow the instructions provided in the "Using Parameters" article ("Using parameters with stored procedures in synchronization mode" paragraph) to avoid the problem.
Please follow the instructions provided in the "Using Parameters" article ("Using parameters with stored procedures in synchronization mode" paragraph) to avoid the problem.
Hi,
I have read this article, and I am setting ParameterCheck = true. I don't call Prepare() because I am using a stored procedure. But the order of arguments still seems messed up. It is dependent upon which order I add the parameters to the command object.
I am essentially building a database builder, so I can't know the order that the parameters will be added to the command object. I need to be able to set the paramters by name, independent of the order.
Thanks for your help.
I have read this article, and I am setting ParameterCheck = true. I don't call Prepare() because I am using a stored procedure. But the order of arguments still seems messed up. It is dependent upon which order I add the parameters to the command object.
I am essentially building a database builder, so I can't know the order that the parameters will be added to the command object. I need to be able to set the paramters by name, independent of the order.
Thanks for your help.