Sql Query Required in QueryBuilder

Last post 07-08-2009 3:23 AM by nijhawan.saurabh. 1 replies.

Sort Posts:

  • Sql Query Required in QueryBuilder

    07-07-2009, 3:30 AM
    • Member
      32 point Member
    • ziazai123
    • Member since 06-29-2009, 8:06 AM
    • Posts 270

    I am working on Visual Web Developer 2005 (vb.net).

    I have to write query in a QueryBuilder.

    I have three fields:

    1. NWOID (integer) Primary key

    2. CustID (String)

    3. CPNRef (String)

    I need a query for a WHERE clause that will return if I provide any one parameter or combination of parameters or nothing.

    for example:

    (NWOID)

    (CustID)

    (CPNRef)

    (NWOID, CustID)

    (NWOID, CPNRef)

    (CustID, CPNRef)

    (NWOID, CustID, CPNRef)

    (            )    nothing

    Ziauddin (MCS)
    Virtual University
  • Re: Sql Query Required in QueryBuilder

    07-08-2009, 3:23 AM
    Answer

    Well create a stored procedure in sql server with three parameters and set defaults for two fields, now you may call that stored procedure with :

    1 argument

    2 arguments

    3 arguments

    It would work in all cases and as you wanted!

    Saurabh Nijhawan(B.Tech. CSE,GGSIPU,New Delhi)
    Application Architect, Eminent Solutions, New Delhi.
    Freelancer | Teacher
    Remember to click "Mark as Answer" on the post, if it helped you.
    ASP.NET Weblog
    http://www.saurabhnijhawan.com
    Learning Made Easy


Page 1 of 1 (2 items)