Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6226225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:59:07+00:00 2026-05-24T08:59:07+00:00

I am trying to perform a search query using drop down boxes with a

  • 0

I am trying to perform a search query using drop down boxes with a button named search. I want it to bring up the data that is searched for. I dont know where to start from, i have looked around for some coding and different ways to do it but they seem complicated, this is the bit of ASP that is my weakness, need some assistance and guidance. below is the code for the page;

   <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ForSale.aspx.vb" Inherits="Users_ForSale" title="Properties For Sale" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


    <h3>Properties For Sale</h3>
    <h5>
        <asp:Label ID="lblTown" runat="server" Text="Town:"></asp:Label>
        <asp:DropDownList ID="ddlTownSearch" runat="server">
            <asp:ListItem></asp:ListItem>
            <asp:ListItem>Chadderton</asp:ListItem>
            <asp:ListItem Value="Failsworth"></asp:ListItem>
            <asp:ListItem>Oldham</asp:ListItem>
            <asp:ListItem>Royton</asp:ListItem>
            <asp:ListItem>Shaw</asp:ListItem>
        </asp:DropDownList>
        <asp:Label ID="lblBedroomsSearch" runat="server" Text="Bedrooms:"></asp:Label>
        <asp:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem></asp:ListItem>
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem Value="2"></asp:ListItem>
            <asp:ListItem Value="3"></asp:ListItem>
            <asp:ListItem>4</asp:ListItem>
            <asp:ListItem>5</asp:ListItem>
            <asp:ListItem>6+</asp:ListItem>
        </asp:DropDownList>
        <asp:Label ID="lblMinPrice" runat="server" Text="Min Price (£):"></asp:Label>
        <asp:TextBox ID="txtMinPriceSearch" runat="server" Width="87px"></asp:TextBox>
        <asp:Label ID="lblMaxPriceSearch" runat="server" style="text-align: left" 
            Text="Max Price (£):"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" Width="87px"></asp:TextBox>
    </h5>
    <h5>
        <asp:Button ID="btnForsaleSearch" runat="server" Text="Search" />
    </h5>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
            DataKeyNames="ProductId" DataSourceID="SqlDataSource1" ForeColor="#333333" 
            GridLines="None" Width="588px">
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <Columns>
                <asp:ImageField DataImageUrlField="ImageURL">
                </asp:ImageField>
                <asp:BoundField DataField="ProductId" HeaderText="ProductId" ReadOnly="True" 
                    SortExpression="ProductId" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
                <asp:BoundField DataField="Town" HeaderText="Town" 
                    SortExpression="Town" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:JPEstatesConnectionString %>" 
    SelectCommand="SELECT * FROM [Products]" 
        DeleteCommand="DELETE FROM [Products] WHERE [ProductId] = @ProductId" 
        InsertCommand="INSERT INTO [Products] ([ProductId], [Description], [Price], [Category], [ImageURL]) VALUES (@ProductId, @Description, @Price, @Category, @ImageURL)" 
        UpdateCommand="UPDATE [Products] SET [Description] = @Description, [Price] = @Price, [Category] = @Category, [ImageURL] = @ImageURL WHERE [ProductId] = @ProductId">
            <DeleteParameters>
                <asp:Parameter Name="ProductId" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Price" Type="Decimal" />
                <asp:Parameter Name="Category" Type="String" />
                <asp:Parameter Name="ImageURL" Type="String" />
                <asp:Parameter Name="ProductId" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ProductId" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Price" Type="Decimal" />
                <asp:Parameter Name="Category" Type="String" />
                <asp:Parameter Name="ImageURL" Type="String" />
            </InsertParameters>
    </asp:SqlDataSource>

</asp:Content>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:59:08+00:00Added an answer on May 24, 2026 at 8:59 am

    It depends on your strategy, if you want to search with EXACTLY same matches your search query will be like this:
    SELECT * FROM [Products] WHERE [ProductId]=@ProductID AND [Price]=@Price AND…and other conditions that you need.

    and if you like to retrieve similar results you have to use LIKE instead of ‘=’ like this one:
    SELECT * FROM [Products] WHERE [ProductId] LIKE '%' + @ProductId+ '%' AND ([Price] BETWEEN @Price1 AND @Price2) AND…and other conditions

    Price1 and Price2 can be range of user input price

    It helps you for using ASP.NET SQLParameters with LIKE statement

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to perform a single search on a single column of data
I'm using the linkedin JS API I'm trying to perform people search , It's
I am trying to perform a Twitter search using the PEAR package Services_Twitter. Unfortunately
I am trying to perform a search for documents within a SharePoint site, but
I'm trying perform a relatively basic TCP socket send/receive operation on Windows CE using
Trying to perform a single boolean NOT operation, it appears that under MS SQL
I'm trying to perform a LINQ query on a DataTable object and bizarrely I
I'm trying to perform a SQL query through a linked SSAS server. The initial
I'm trying to perform a simple LINQ query on the Columns property of a
I'm trying to perform a search-replace in several JCLs but I need multi-line capabilities,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.