If you only want to get the employees directly employed by IORI (ignore persons employed by MAI or ATHENA), you can simply use a SELECT:
SELECT EmpNaam FROM dbo.Emp WHERE ID = @Root
Well, we can do a little modification to the stored procedure, but the returned result will still be table-formed result set, you will still face the problem how to get a direct-viewing employ tree from the result set. The only work around I can find is to use a OUTPUT parameter in the stored procedure to host the strings used to be printed in the original sp:
ALTER PROC [dbo].[ShowHierarchy] @Root int,@outstring VARCHAR(8000) OUTPUT
AS
BEGIN
SET NOCOUNT ON
DECLARE @EmpID int, @EmpNaam varchar(30)
SET @EmpNaam = (SELECT EmpNaam FROM dbo.Emp WHERE EmpID = @Root)
SET @outstring= @outstring+REPLICATE('-', @@NESTLEVEL * 4) + @EmpNaam +'
'
SET @EmpID = (SELECT MIN(EmpID) FROM dbo.Emp WHERE ID = @Root)
WHILE @EmpID IS NOT NULL BEGIN
EXEC dbo.ShowHierarchy @EmpID,@outstring OUTPUT
SET @EmpID = (SELECT MIN(EmpID) FROM dbo.Emp WHERE ID = @Root AND EmpID > @EmpID)
END
END
DECLARE @outstring varchar(8000)
SET @outstring=''
EXEC [ShowHierarchy] 1,@outstring output
PRINT @outstring
Then in your code you can use a SqlCommand with an OUTPUT parameter to execute the stored procedure and store the output string into a variable. You can refer to: Working with Command Parameters
Please do remember to initialize the output parameter to an empty string ('') before you use it in the sp.