update query returns -1 value eventhough the data is updated in database . I am using sql server 2005 stored procedure with c#.
My stored procedure is as follows…
ALTER procedure [dbo].[sp_changepwd]
(
@Cust_Id varchar(50),
@Password varchar(50),
@OldPassword varchar(50),
@Username varchar(50)
)
as
Begin
SET NOCOUNT ON
Begin Tran
update
Customer_Utility_Reg_M_Tbl
set
Password=Convert(varbinary(50),@Password)
where
Cust_Id=@Cust_Id and Password=@OldPassword and Username=@Username
IF @@ERROR = 0
COMMIT TRAN
ELSE
ROLLBACK TRAN
RETURN (@@ERROR)
END
SET NOCOUNT OFF when you SET NOCOUNT ON it doesnt report the number of record affected