Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Implementing unlimited categories in the database Expand / Collapse
Author
Message
Posted Thursday, August 27, 2009 11:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 20, 2013 8:06 AM
Points: 9, Visits: 51
I'm trying to implement a table in my database that supports the creation of unlimited categories via asp.net front end, here's the structure thus far...

id, category_name, parent_id

is this correct cause logically? So in asp.net if I have a listview or some other component it should display like this...

0
-0_0
-0_1
-0_N
-1
-1_0
-1_1
-1_N
-2
-2_0
-2_1
-2_N
-3
-3_0
-3_1
-3_N
-N
-N_0
-N_1
-N_N
Post #778541
Posted Friday, August 28, 2009 7:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 21, 2009 4:48 PM
Points: 4, Visits: 10
Can you be a little more specific? For example, will you have more than one level of parent/child hierarchy? Is this simply to populate a list box or drop down list? Etc. If you plan on having a complex parent/child hierarchy, then take a look at this article.
http://weblogs.asp.net/aghausman/archive/2009/03/16/storing-retrieving-hierarchical-data-in-sql-server-database.aspx
Post #779073
Posted Saturday, August 29, 2009 4:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 20, 2013 8:06 AM
Points: 9, Visits: 51
Thanks for the reply SqlGeek. Yes I plan to have a complicated hierarchy using a listbox or any other component (.net) that can handle explorer type views. Thanks for the link, I'll check it out as it looks promising to what I'm trying to do.
Post #779400
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse