I am havign soem trouble wrapping my brain around the most efficient way to create a user control that displays the current category in a shopping cart with the parent category to the left. For examle if you were looking at the "Mechanical Pencils" category
you might see something like the text below: Office Supplies > Writing Utensils > Pencils > Mechanical Pencils I am using stored procedures and making each element of the page modular and in a user control, so to access the data I need to write a stored procedure.
Currently my table is setup with the following fields: CategoryID, ParentCategoryID, CategoryName My problem is that I don't know how to write the procedure to look at a category, find the parent, find that category and then find it's parent, etc. Could someone
give me an idea of what that procedure might look like and what results it would return?
I don't think I understand what you mean. Here is what I am looking at: I want to make a single stored procedure that responds with the results up the tree of categories. Here is the table the information comes from: --- CatID ParentID CategoryName --------------------------------------------------
1 0 "Writing Utensils" 2 1 "Pens" 3 2 "Ball Point Pens" 5 1 "Pencils" 6 5 "Wooden Pencils" 7 2 "Quills" 8 5 "Mechanical Pencils" --- So when I am in the "Mechanical Pencils" section of the shopping application I want the header to look like this: --- Writing
Utensils > Pencils > Mechanical Pencils --- So what would teh stored procedure look like to find this info?
ectropic
Member
90 Points
18 Posts
Category Header Stored Procedure
Sep 04, 2003 07:41 PM|LINK
www.ectropicinteractive.com
My Blog ShortDomainName.com
tomaki
Member
141 Points
32 Posts
Re: Category Header Stored Procedure
Sep 04, 2003 10:00 PM|LINK
ectropic
Member
90 Points
18 Posts
Re: Category Header Stored Procedure
Sep 05, 2003 06:53 PM|LINK
www.ectropicinteractive.com
My Blog ShortDomainName.com