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

  • SEARCH
  • Home
  • 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 6108515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:18:16+00:00 2026-05-23T14:18:16+00:00

I am looking to provide a search for clients in which they can select

  • 0

I am looking to provide a search for clients in which they can select multiple categores
(check boxes) and view only the results in those categories in a
gridView control. For instance example would
be if the user checks item price > 100 and price < 100 then they would only get items with respect to that checkbox selected and all the other selection criteria should not be populated to datalist.
I just dont know how to generate the dynamic multiple query depending on the selection and how will i get the selected checkbox list so that i can pass that to the sql query. Any help or tutorials will be appreciated. Also when the checkbox is deselected the items of that selection should dissapear from the datalist.

Issue Resolved:

 static public DataTable GetSelectedFilter(ArrayList test)
{

    string sqldef = "Select * from productDetail Where";
    string sql = "";
    int check = 0;
    int number  = test.Count;
   string OR = "OR";
    //ArrayList arrlist = new ArrayList();
    if (test.Count > 0)
    {

        while (number > check)
        {

                sql += "((Price between " + test[number - 1] + "))" + OR;


            number--;


        }

        string completeQuery = sqldef + sql;
        string sqltest = completeQuery.Substring(0, completeQuery.Length - 2);
        string finalQuery = sqltest + "order by Price";

        SqlDataAdapter da = new SqlDataAdapter(finalQuery, ConnectionString);
        DataTable dt = new DataTable();
        da.Fill(dt);
        return dt;
    }
    else
    {
        string sql1 = "Select * from productDetail";

        SqlDataAdapter da = new SqlDataAdapter(sql1, ConnectionString);
        DataTable dt = new DataTable();
        da.Fill(dt);
        return dt;
    }

}
  • 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-23T14:18:16+00:00Added an answer on May 23, 2026 at 2:18 pm

    It was an issue with sql query , it works fine now

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

Sidebar

Related Questions

I am looking for a library or database that can provide guesses about whether
We're looking to provide a fuzzy search on an electrical materials database (i.e. conduit,
I'm looking for a search solution and i can't seem to find it. It's
I'm using C# to continuously search for multiple string keywords within large strings, which
I'm looking into using Lucene and/or Solr to provide search in an RDBMS-powered web
I'm looking at using Elasticsearch to provide the search functions of our site. I've
i'm looking for gem(s) which will provide me tools for File and Directory manipulation.
I am looking to provide a better way of managing the distribution and storage
I'm not sure I'm asking the right question here, but I'm looking to provide
We are looking for a way to provide failover for ACS instances, so if

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.