problem calling parametrized stored proc mysql

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
vpasman2
Posts: 1
Joined: Fri 10 Oct 2008 23:12

problem calling parametrized stored proc mysql

Post by vpasman2 » Fri 10 Oct 2008 23:31

Can someone please explain why the following code does not work. I'm trying to call a parametrized stored procedure to mysql. This is the error I get: Table 'instruments.insert_usequity_easy_to_borrow' doesn't exist. It thinks it's a table, not a stored proc:(
Appreciate any help.
Thanks,
Vlad

cmd = new MySqlCommand("insert_usequity_easy_to_borrow");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("symbol", MySqlType.VarChar, 10, "symbol");
cmd.Parameters.Add("isEasyToBorrow", MySqlType.Bit, 1, "isEasyToBorrow");
cmd.Connection = conn;
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.UpdateCommand = cmd;
adapter.InsertCommand = cmd;
adapter.Update(_ds, "USEquityEasyToBorrow");

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 13 Oct 2008 09:49

Try using MySqlParameter's constructor without setting SourceColumn.
For example, use

Code: Select all

cmd.Parameters.Add("symbol", MySqlType.VarChar, 10);
instead of

Code: Select all

cmd.Parameters.Add("symbol", MySqlType.VarChar, 10, "symbol");

Post Reply