MySQL Forums
Forum List  »  Newbie

Re: using connector/net
Posted by: Emanuele Scozzafava
Date: September 07, 2004 01:09AM

Reggie

I tryed with "old syntax=yes", but the result doesn't change.
This is the code:
MySqlConnection cn = new MySqlConnection();
cn.ConnectionString = "Data Source=localhost;database=controllodocumenti;old syntax=yes;";
cn.Open();

MySqlCommand cm = new MySqlCommand();
cm.CommandType = CommandType.StoredProcedure;
cm.Connection = cn;
cm.CommandText = "sp_test";

cm.Parameters.Add("par0", MySql.Data.MySqlClient.MySqlDbType.Int32).Value = 3;
MySqlDataReader dr = cm.ExecuteReader(CommandBehavior.SingleResult);

This is the stored procedure:
CREATE PROCEDURE sp_test (par0 int)
begin
select * from table0;
end

The cm.ExecuteReader generates this error message:
#42000Incorrect number of arguments for PROCEDURE sp_test; expected 1, got 0

I debugged the code and cm.Parameters is correctly populated!

Options: ReplyQuote


Subject
Written By
Posted
September 06, 2004 08:55AM
September 06, 2004 10:16AM
Re: using connector/net
September 07, 2004 01:09AM
September 07, 2004 05:54AM
September 07, 2004 07:08AM


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.