I think you are missing the code that sets the command type to stored procedure.
Can you post your code again? Just the part that creates the connection object, opens the connection, creates the command type, set command type to stored procedure and the line of code that executes it.