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 4087486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:51:41+00:00 2026-05-20T18:51:41+00:00

I have a CheckBoxList that is showing all A table C column. SELECT DISTINCT

  • 0

I have a CheckBoxList that is showing all A table C column.

SELECT  DISTINCT C
FROM A
ORDER BY C

My A table has two columns.

B–>Primary Key

C–> Every C has a unique B.

I have an SQL like this for my Gridview Source;

Select <...............>
From <..................>
Where <.................>
AND A.B IN 
(Select A.B 
From A 
Where A.C IN ALL CheckBoxList.SelectedItem.Value)

Something like that. My SQL syntax isn’t very good. I hope you can tell what I want..

What I REALLY want is, when I click a button, Gridview should be populated according to the SQL , BUT filtered by what is selected in CheckBoxList.

Is there any way to add a parameter in the SQL IN clause?
How can I do that?

Best Regards,

Soner

  • 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-20T18:51:42+00:00Added an answer on May 20, 2026 at 6:51 pm

    When I encountered an issue like this, I took a data table (precomputed, equivalent to all the boxes being checked) and just used a LINQ query (I asked about that query here). Basically, in the context of your question, I just used a standard LINQ query, building a filter by ORing all the checkboxes to form a filter. I created the filter itself using PredicateBuilder. I only needed the 26 lines of code under “Predicate Builder Source Code.”

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

Sidebar

Related Questions

Lets say I have a simple table that only contains two columns: MailingListUser -
I have an ASP.NET server control that inherits from CheckBoxList that renders the controls
I have a checkboxlist in C# that is databound from the database. What I
I have a CheckBoxList where users can select multiple items from the list. I
I have a CheckBoxList that displays a list of checkboxes using data from a
ASP.NET and C#. I'd like to have a CheckboxList with a Select All item.
I have a mini form that consists of all select boxes and checkbox lists.
I have two classes one is derived from CheckBoxList and the second one from
I have a CheckboxList that seems to load and do everything right, except for
I have an asp.net panel that contains a checkboxlist. I'd like to resize it

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.