HI
I have insert.aspx page that users can enter data and when they click on insertbutton it insert data into database below is SP
create procedure [dbo].[InsertFreeState2]
@Name nvarchar(40)
,@mobile varchar(20)=null
,@Tell varchar(15)=null
,@Transfer nvarchar(20)
,@Type nvarchar(20)
,@id int =0
,@Result NVARCHAR(120) OUTPUT
AS BEGIN
IF ((NOT EXISTS(SELECT id FROM Estate_free WHERE (Mobil = @Mobile or Tell=@Tell))) AND (NOT EXISTS(SELECT id FROM Black_List WHERE Mobile = @Mobile or Tell=@Tell)))
begin
IF EXISTS(SELECT id FROM Estate_free WHERE id = @id AND @id > 0 )
BEGIN
UPDATE Estate_free
SET
Name=@Name
,Mobil=@mobile
,Tell=@Tell
,Transfer=@Transfer
,Type=@Type
WHERE ID=@id
SELECT @id
SET @Result = 'you have been registered.'
END
ELSE
BEGIN
INSERT INTO Estate_free(Name,Mobil,Tell,Transfer,Type)
VALUES(@Name,@Mobile,@Tell,@Transfer,@Type)
SET @Result = 'you have been registered.'
END
END
ELSE
begin
SET @Result = 'you can just register 1 Time '
END
END
here when users enter new mobile number it should insert data into database and show 'You have been registered' and if they enter Mobile number that was in table it shouldn't insert data into database and show=='You can just register 1 Time'
probelm is when I enter new mobile number it inserted data into database but it showed this message'You can just register 1 Time' but here it should show 'You have been registered'
I mean in both condition it show this message 'You can just register 1 Time'
it never show this message='You have been registerd'
what should i do?
Best Regards
Neda