Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Implementing unlimited categories in the database


Implementing unlimited categories in the database

Author
Message
robertlewis2001
robertlewis2001
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 52
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
SQLGeek-652125
SQLGeek-652125
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
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
robertlewis2001
robertlewis2001
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 52
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search