I have a return code from a stored procedure that I need to verify. I can't change the proc because it is part of a vendor package. Changing it to an output parameter is not possible. I don't care so much about the parameters as capturing the return code in c#. Here is an example of what I'm trying to do: Procedure:
create proc tester
@parm nvarchar(3)
as
if @parm = 'Yes'
return 1
else
return -1
go
C# sample code:
SqlConnection sqlMon = new SqlConnection("Whatever");
sqlMon.Open();
SqlCommand sqlcomm = new SqlCommand("tester", sqlMon);
SqlDataReader sqlR;
sqlcomm.CommandType = CommandType.StoredProcedure;
sqlcomm.Parameters.Add(new SqlParameter("@parm", "Yes"));
sqlR = sqlcomm.ExecuteReader();
sqlMon.Close();
What I can't figure out is how do I now get the return code. Any help you can provide is appreciated. Thanks.