I have a stored procedure in SQL, when I run this stored procedure, I get the number 38, but when I try to run it in C#, I get the number 0x00000026
.
How can I convert it to a "normal" number?
The stored procedure:
ALTER PROCEDURE Registration
(@UserName nvarchar(50),
@Password nvarchar(9),
@FirstName nvarchar(50),
@LastName nvarchar(50),
@EmailAddress nvarchar(50),
@BDate date,
@IdentityNumber nvarchar(50),
@RoleID int)
AS
IF (SELECT COUNT(1) FROM Users WHERE UserName =@UserName) = 1
BEGIN
RETURN -1
END ELSE
BEGIN
INSERT INTO Users(UserName, Password, FirstName, LastName, Email, IdentityNumber, BirthDate, RoleID)
VALUES(@UserName, @Password, @FirstName, @LastName, @EmailAddress, @IdentityNumber, @BDate, @RoleID)
RETURN Cast(@@IDENTITY as INT)
END
and the data access layer code:
User test1 = DB.Users.Where(u => u.UserName == "223321").ToList();
var test2 = from users in DB.Users
where users.UserName == "223321"
select new
{
users.UserName,
users.UserID
};
Watch window allows you to view the variables values in Hex Mode. This is very simple features, Just Right Click on Watch window and unselect Hexadecimal Display.
So Click To unselect Hexadecimal Display option for output -'38'
User contributions licensed under CC BY-SA 3.0