Where is the method ParamByName from MySqlCommand

Where is the method ParamByName from MySqlCommand

Postby Thomas J. » Mon 02 Apr 2012 06:46

Hello all,

in C++ (VCL) I'm using TMyQuery to process SQL commands and the method ParamByName to access the parameters.
I cannot find the method.
Only the simple index method like

Code: Select all
sqlCommand.Parameters[0].Value = 60;

Thomas J.
Posts: 95
Joined: Mon 21 Nov 2005 12:16
Location: Germany

Postby Pinturiccio » Tue 03 Apr 2012 11:38

Code: Select all
MySqlCommand comm = new MySqlCommand();
comm.Parameters; //returns the MySqlParameterCollection object for the corresponding MySqlCommand object.

If you want to get access to a parameter from the MySqlParameterCollection class by the parameter name, then you should use index with this name. The index is overloaded in the MySqlParameterCollection class.
Let's consider that you have the MySqlCommand comm variable with the parameter "param". Then you can get access to this parameter as shown in the following code:
Code: Select all
comm.Parameters["param"].Value = 60;

For more information, please refer to:
http://www.devart.com/dotconnect/mysql/ ... ng%29.html
http://www.devart.com/dotconnect/mysql/ ... eters.html
Devart Team
Posts: 2082
Joined: Wed 02 Nov 2011 09:44

Return to dotConnect for MySQL