Skip to content

How to create Advanced seaarch in win forms ?

ghasem deh

ghasem deh

Asked Aug 30, 2015, 10:09 AM EDT2 answers
Share
LinkedInX
hi guy's
how to create Advanced Search in My form similar this :
 
 
i want if user complete filter items , search done with filter ... 
else search done only with text (in text box) 
 
i don't use Stored Procedure ! 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • ghasem deh
    0
    i use this code :
     
    USE [Advanced_Search Test]
    GO
    /****** Object: StoredProcedure [dbo].[SP_AdvanceSearch] Script Date: 31/08/2015 05:32:28 ?.? ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[SP_AdvanceSearch]
    (
    @Commodity nvarchar(50)= null,
    @Exist int = null,
    @Category nvarchar(50) = null,
    @Warehouse nvarchar(50) = null
    )
    AS
    BEGIN
    SELECT * FROM [dbo].[Full_View]
    WHERE (
    Commodity LIKE COALESCE(N''+@Commodity+'', Commodity)
    AND Exist = COALESCE(@Exist, Exist)
    AND Category LIKE COALESCE(N''+@Category+'', Category)
    AND Warehouse LIKE COALESCE(N''+@Warehouse+'', Warehouse)
    )
    END
     
    well done !
    butt , how to get betwwen value1 and value2 ? 
    0
  • 1 short reply
    • ghasem deh
      0
      Nobody does not help ?
      0