Page 1 of 1
Universal dotconnect mysql parameter problem
Posted: Mon 25 Apr 2016 15:43
by mobra
Hi,
Since the updated universal dotconnect release for Visual Studio 2015 the parameters aren't working for mysql.
Running the same query, but replacing the parameter with quoted text i get the correct results.
I made a sample:
http://mobra.erpos.ro/Products/UniDirectTest.zip
Any idea?
Re: Universal dotconnect mysql parameter problem
Posted: Wed 27 Apr 2016 15:01
by Pinturiccio
dotConnect Universal has two types of the named parameters. The difference between them lies in prefixes ':' and '@'. Name of the UniParameter object in the command collection should contain the '@' prefix, if parameter in CommandText is used with the '@' prefix. For more information, please refer to
https://www.devart.com/dotconnect/unive ... eters.html
To fix the issue, add the '@' character before the parameter name. Your code should look like the following:
Code: Select all
string commandText = string.Format(txtCommand.Text, "@ModuleId");
UniCommand cmd = new UniCommand(commandText, this.connection);
UniParameter p = new UniParameter("@ModuleId", UniDbType.VarChar);
Re: Universal dotconnect mysql parameter problem
Posted: Fri 29 Apr 2016 06:35
by mobra
Thank you, it seems that it works, at least in this example.
Pretty annoying update, i have a few hundred queies (or better, thousands) in a single app, and is working well with version 3.5. Now i must update to 3.6 and all of them are broken
Thank you, again.
m.