Description:
As reported in the following forum post
http://forums.mysql.com/read.php?174,609081,609081#msg-609081
Trying to create a TableAdapter from existing stored procedures, using as SELECT stored procedure, one with arguments, fails (the TypedDataSet designer does not seems to detect the arguments).
Returning an error like Parameter 'nameOfParameter' not found in the collection
How to repeat:
1. Add a DataSet to a Visual Studio project
2. Add a new TableAdapter, choose a MySql connection
3. Choose to create the TableAdapter from existing stored procedures
4. As SELECT stored procedure chose one that returns a result set and requires at least one argument.
The following sample stored routine causes the issue:
-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_0022_LST_GRUPOS`(IN instituicaoID INT, IN acao TEXT)
BEGIN
-- If the parameter acao is "list" then show all courses of table
if acao="listar" then
SELECT * FROM `tbl_grupos` INNER JOIN(`tbl_instituicao`) ON
(`tbl_grupos`.`grupo_instituicao`=`tbl_instituicao`.`instituicao_id`);
end if;
-- If the parameter acao is "filter" then just show all course of school of the parameter instituicaoID
if acao="filtrar" then
SELECT * FROM `tbl_grupos` INNER JOIN(`tbl_instituicao`) ON
(`tbl_grupos`.`grupo_instituicao`=`tbl_instituicao`.`instituicao_id`)
WHERE `tbl_grupos`.`grupo_instituicao` = instituicaoID;
end if;
END
Suggested fix:
Must work with stored procedures with arguments