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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:15:04+00:00 2026-06-11T15:15:04+00:00

I am building a classified-ads website using asp.net web forms and linq-to-sql. The items

  • 0

I am building a classified-ads website using asp.net web forms and linq-to-sql.

The items for sale need to be categorised in a hierarchical manner, however, an individual item may be in multiple child categories.

For an example take a look at this battery on eBay. Notice there are two breadcrumbs:

Sound & Vision > Multipurpose Batteries & Power > Rechargeable Batteries
and well as:
Computers/Tablets & Networking > Laptop & Desktop Accessories > Laptop Batteries

In addition to an item belonging to multiple categories, a category may have more than one parent as well, e.g. when browsing the categories “Sound & Vision > Batteries” or “Electronics > Batteries”, one should see the exact same sub-categories of Batteries in both cases (e.g. Rechargeable or Non-Rechargeable, etc).

I’m uncertain as to how to even begin structuring the database tables, let alone querying them from the web site, so any help or guidance would be much appriciated.

I’ve looked at articles such as Storing Hierarchical Data in a Database, but don’t think it would apply in my case due to the many-to-many nature of the items and categories.

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-06-11T15:15:04+00:00Added an answer on June 11, 2026 at 3:15 pm

    Thanks to @bhrugesh-patel and @andrew-walters for attempting to answer my question. However, on further research it appears that the hierarchy described above is called a Directed Acyclic Graph (DAG), i.e. almost a tree but with one major difference: you can reach the same node through different paths.

    Graph Databases such as Neo4j are designed for storing structures like DAGs, but as I’m stuck with using a relational database (SQL Server), I’ll attempt to implement the solution mentioned in this article: A Model to Represent Directed Acyclic Graphs (DAG) on SQL Databases.

    FYI: Another question on SO also discusses this topic in more detail.

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

Sidebar

Related Questions

Building a new ASP.net application, and planning to separate DB, 'service' tier and Web/UI
Building a sample ASP.NET MVC app. Using the Membership API for authentication. For whatever
Building a relatively simple website, and need to store some data in the database
Building an ASP.NET MVC3 application at work and I'm trying to use a program
Building my first web app using Yii and wondering if it is best to
Building an MVC 2.0 web site and using Content Delivery Network (CDN) in my
Building a new Mobile Web Platform for Mobile Users to purchase & download content
building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
Building an app using android.support.v4.app , targeting API level 8. Everything's working as planned

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.