hi according to below thread I wrote SP
Hide-Shown-Items-in-GridView-based-on-stored-procedure-in-ASPNet/
there was just for 1 Table Now I have 3 table that I want do same thing for them below are SP
alter procedure [dbo].[Search_number3]
@Mobile nvarchar(15)
as
begin
SET NOCOUNT ON
select (select Ownername from House_Info where Mobile=@Mobile) as Name,(select Mobile from House_Info where Mobile=@Mobile) as ContactNo,
(select BehcodeN from House_Info where Mobile=@Mobile) as BehcodeN,(select ID from House_Info where Mobile=@Mobile) as Id,
(select Mobile from Estate_free where Mobile=@Mobile ) as ContactNo1,(select Mobile from Black_list where Mobile=@Mobile ) as ContactNo2,
(select BehcodeN from Estate_free where Mobile=@Mobile ) as Freg
end
I mean I want when I enter Mobile Or PhoneNumber it search in 3 Table And if there was mobile it show mobile Number and if there was PhoneNumber It show Phonenumber
I did it just for 1 Table Now I want do it for above SP
ALTER procedure [dbo].[Search_numberT]
@Mobile nvarchar(15)
AS
BEGIN
SET NOCOUNT ON
IF EXISTS (SELECT Mobile FROM House_Info WHERE Mobile=@Mobile)
BEGIN
SELECT ID,Name,Mobile AS ContactNo,' ' as code
FROM
House_Info
WHERE Mobile=@Mobile
END
ELSE
BEGIN
SELECT ID,Name,Tell AS ContactNo,Code
FROM
House_Info
WHERE Tell=@Mobile
END
end
Best Regards