How can I get Stored Procedure return value in C#?
问题 I have a stored Procedure that do some operation and return 1 or 0 as below CREATE PROCEDURE dbo.UserCheckUsername11 ( @Username nvarchar(50) ) AS BEGIN SET NOCOUNT ON; IF Exists(SELECT UserID FROM User WHERE username =@Username) return 1 ELSE return 0 END and in C# i want to get this returned value i try ExcuteScalar but it didn't return any value ( i know if i replace return 0 with Select 0 ExcuteScalar will catach it .. but is it any way that allow me to get returned value with replace