List:General Discussion« Previous MessageNext Message »
From:Jesse Castleberry Date:November 17 2005 6:28pm
Subject:Command Denied on Stored Procedure
View as plain text  
I'm trying to execute a MySQL Stored Procedure from my ASP.NET page:

   Cmd=New MySqlCommand("sp_InsertNewCamper",Conn)
   Cmd.CommandType = CommandType.StoredProcedure
   paramReqID = Cmd.Parameters.Add("return",SqlDbType.Int)
   paramReqID.Direction = ParameterDirection.ReturnValue
   Cmd.Parameters.Add("FirstName",FirstName.Text)
   Cmd.Parameters.Add("LastName",LastName.Text)
   Cmd.Parameters.Add("UserName",UserName.Text)
   Cmd.Parameters.Add("Password",Password.Text)

   Cmd.ExecuteNonQuery()
   cID = CStr(Cmd.Parameters("return").Value)

When I execute this code, I get the error, "42000 SELECT command denied to
user 'FCCamp'@'localhost' for table 'proc'".

The Stored Procedure is as follows:

  CREATE Procedure sp_InsertNewCamper(
     in cFirstName VarChar(30),
     in cLastName VarChar(30),
     in cUserName VarChar(30),
     in cPassword VarChar(30),
     out AddedID Int)
   BEGIN
     INSERT INTO Campers (FirstName, LastName, UserName, Password) VALUES
       (cFirstName, cLastName, cUserName, cPassword);
     Set AddedID = LAST_INSERT_ID();
   END;

The user "FCCamp" has SELECT rights on this database, but there is no "proc"
table.  And I don't know how to assign rights to execute stored procedures
if that is even necessary.

Anyone know how to take care of that.

Thanks,
Jesse

Thread
Command Denied on Stored ProcedureJesse Castleberry17 Nov