The code looks good at first glance - the only thing I can see that can explain this behavior: you have defined your parameter @resultas ParameterDirection.InputOutput- but you are not giving any value to this parameter from the input side ...
Try adding this line before adding parm2to the collection cmd.Parameters:
parm2.Value = string.Empty;
Will anything change?
: ParameterDirection.Output ( InputOutput) - ?