Click here to Skip to main content
15,886,724 members

Comments by UDTWS (Top 27 by date)

UDTWS 15-Sep-22 16:29pm View    
Deleted
.
UDTWS 10-Apr-20 9:54am View    
if i want to check if faculty name already exists than how to solve this problem using store procedure. i am facing problem duplicate user while insert i want to stop duplicate user while insert.
Thanks in advance
UDTWS 10-Apr-20 9:50am View    
from two days i am try different different method to solve problem but still problem not solved. please check once again my code and help to resolve issue.
Thanks & Regards
UDTWS 9-Apr-20 18:33pm View    
Thanks for reply but still Problem not solved. Procedure or function 'spCreateUser' expects parameter '@result', which was not supplied. and i given another sp than duplicate user not entered but how message show that user already exists.
UDTWS 9-Apr-20 10:16am View    
i change in my store procedure as below
alter PROCEDURE spCreateUser
@userName varchar(20),
@pass varchar(30),
@email varchar(50),
@userRole int,
@userPhoto varchar(100),
@userStatus int

AS
IF (SELECT COUNT(*) FROM tbl_user WHERE userName= @userName) < 1
BEGIN
INSERT INTO tbl_user(userName,pass,email,userRole,userPhoto,userStatus)
VALUES(@userName,@pass,@email,@userRole,@userPhoto,@userStatus)
END

it works but if not insert value due to duplicate how mange error message in C# any method