I have a simple SQL Server stored procedure:
ALTER PROCEDURE GetRowCount ( @count int=0 OUTPUT ) AS Select * from Emp where age>30; SET @count=@@ROWCOUN
you have to specify that it is a stored procedure not a query
cmd.CommandType = CommandType.StoredProcedure;