You must Sign In to post a response.
  • Category: ASP.NET

    Doing Multiple Search in asp.net

    hi every one,
    please check my below screen shot. i'm trying multiple search and it's all are static and getting data in dynamic.
  • #765911
    Hi
    sadiq

    Where is your Snapshots? I canot find here.

    Can you share your issue elaborate then only who reply in your issue give solution properly with quickly

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #765912
    Hi

    If you need search in sql server means try this code



    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar%'

    OR

    Select * from TEST.dbo.sample2 where USERNAME like 'Kumar%'

    OR

    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar'

    OR

    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar%' and password like '%AA%'


    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #765917
    please check in top question in left side manage attachments or check it new snopshot.
    Thanks and REgards

    Delete Attachment

  • #765918
    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar%'

    OR

    Select * from TEST.dbo.sample2 where USERNAME like 'Kumar%'

    OR

    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar'

    OR

    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar%' and password like '%AA%'

    i'm trying this type code but it's not working

    my query

    select a.*
    from Tbl_GuesthouseFeatures as a left join Tbl_GuestHouse_Info as b on a.GuesthouseID=b.GuesthouseID
    where a.GuesthouseID=@GuesthouseID or b.GuesthouseName=@GuesthouseName
    or a.Featuresname=@Feature1 or a.Featuresname =@Feature2

  • #765922
    Hi Sadiq,

    I am a bit confused about your question. I can understand it in two ways. One in my opinion is you want to search for a keyword in all tables of your database, you have to run a loop of queries to check on all tables. Have a look at this SO thread.
    http://stackoverflow.com/questions/15757263/find-a-string-by-searching-all-tables-in-sql-server-management-studio-2008

    Another is, and might be more logical as per your screenshot, you want to search for rooms or Hotels those have features checked by users. You might possibly use below query.



    string searchQuery="SELECT * from hotelsTable where hotelName="@SearchText" and isWiFi = @WiFiCheck" and ..... "

    //Add Parameters
    if(chkIsWiFi.checked ==true) ..

    I will share the exact code, once I get to my Visual Studio PC.
    In case of further query, please revert.

    -------------
    Glad to be,
    John Bhatt
    Editor - DNS Forums
    https://www.pyarb.com

  • #765930
    depend upon the checkbox, when user enter some text in textbox you need to search right ?
    I think first you need to check, which checkboxes are checked and according to that you need to add it in where condition.
    following code snippet may help you

    private List<string> arrColors = new List<String>();
    private List<string> arrStyles = new List<String>();

    if (Request.Form["color_spice"] != null) {
    arrColors.Add("spice"); }/// ## NEW CODE: NOTE CONTAINS. . 08/04/11

    if (Request.Form["color_gold"] != null) { arrColors.Add("gold"); }

    string sql = "select * from ado_products_fabrics where [color] in('";
    sql += string.Join("','", this.arrColors.ToArray());
    sql += "')";
    sql += " AND [style] in('";
    sql += string.Join("','", this.arrStyles.ToArray());
    sql += "')";

    WhereClause = sql;/

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765958
    Hi

    sadiq your attachment file from your post also snspshots check your post.

    then My Query this

    Select * from TEST.dbo.sample2 where USERNAME like '%Kumar%'

    If you need In this Query execute menas

    you should DB-> Test and Table Sample2 and table coloumn-> UserName
    and Data -> Kumar Then only you got right answer.

    then in your query need to output means do one thing

    where ever you post this following this steps
    1. share your table script with sample data

    Then only reply members easily find in your issue fix them.

    if you share your table script then only easily find out your issue

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #765969
    Thank you responding,
    i will share my script with stored procedure please checkit.
    Thanks and Regards

    script.sql.txt

    Delete Attachment


Sign In to post your comments