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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:34:26+00:00 2026-05-18T21:34:26+00:00

I have 3 tables with the following columns in my database: tool: toolid, tool_name

  • 0

I have 3 tables with the following columns in my database:
tool: toolid, tool_name
facet: facetid, facet_name
tool_facet: tf_id, tf_toolid, tf_facetid

The third table contains a list of tools and their facets:
e.g.
1 tid2 fid3
2 tid2 fid4
3 tid3 fid2

where tid2 and fid3 are ids for tools and facets respectively.

In another combo box the user has chosen a specific tool. I want to now display the facets that apply to this tool in another combo box.

Any suggestions?

Thanks.

  • 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-18T21:34:26+00:00Added an answer on May 18, 2026 at 9:34 pm

    Surely you simply need to repopulate the second combo box’s items when the user makes a selection in the first?

    You likely don’t want to requery the database each time the user makes a selection and so instead will want to hold a structure in memory of all valid facets keyed on toolid.

    EDIT some further detail based on Dave’s comment:

    Assuming that you already have some code setup to query the database, you want to execute a query (or queries) that give you back the relevant data to hold in a cache and do this as part of your app’s initialisation after connecting to the database. You could create two dictionaries to hold the tool and facet data. For example:

    Dictionary<int, string> _tools = new Dictionary<int, string>();
    Dictionary<int, string> _facets = new Dictionary<int, string>();
    

    and then a third structure that basically holds the data in tool_facet:

    Dictionary<int, List<int>> _tool_facets = new Dictionary<int, List<int>>();
    

    these basically give you an in-memory copy of the tables that you can very quickly enumerate to populate combo boxes. You’ll want to populate the combo boxes with something that holds the ID and a description, something like this will do:

    class ComboBoxIntItem
    {
      private readonly int _id;
      private readonly string _name;
      public ComboBoxIntItem(int id, string name)
      {
        _id = id;
        _name = name;
      }
      public override string ToString()
      {
        return _name;
      }
      public int GetId()
      {
        return _id;
      }
    }
    

    I’m assuming here that you need to know the tool and facet IDs that the user has selected. If you only care about the names then you could just use a single structure like this:

    Dictionary<string, List<string>> _tool_facets = new Dictionary<string, List<string>>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with the following columns: table1: id, agent_name, ticket_id, category, date_logged
I have 3 tables with the following columns : * users : user_id *
I have 2 mysql tables : Question with the following columns : id, question,
I have 2 mysql tables 1. questions: with the following columns: id, title, answer1,
I have following tables in my MySql database : +----------------------------------------------+ PROJECT +----------------------------------------------| +----------------------------------------------| project_id
In one of my MySQL tables, I have following columns: Skills varchar(80) Industry varchar(40)
I have two tables in my database as following: Suggestions Table: ID, Title, Description,
I have two tables in my database. The first one, [nodeActivity] has the following
I have following tables in my database: SuggestionsLog Table: ID, Title, Description. Employee Table:
I have a table in the database with the following columns: ID, Name, Txt

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.