In a c# project, I call a stored procedure as follows:
System.Data.Linq.DataContext dataContext = MembershipContext.GetContext(connectionString);
int returnValue = dataContext.ExecuteCommand("EXEC usp_SomeProcedure {0}, {1}, {2}", param1, param2, param3);
However, ExecuteCommand returns the number of rows affected, and not my stored procedure return value. What would be the easiest way to get this value. I need this because the SP returns 0 on success and a positive int value if an error occurred.
For now, the stored proc uses RETURN to output its return value. However, I could change this for a SELECT or I could also use an output parameter if required.