0

My database structure is:

Table Name: Category
Columns: CategoryID | CategoryName | ParentID

I want to list all categories by their children and their childrens' children also. I'm using WITH for finding all levels in MS SQL, but how can I show that in ASP.NET? I tried many different things about that but nothing has worked for me. I found Treeview in some websites but I didn't use that.

I also have another question about hierarchical data: when I search for a product that is connected to child and list the parent categories how can I show the child's products?

Radim Köhler
  • 122,561
  • 47
  • 239
  • 335
Kaan Kılıç
  • 27
  • 1
  • 6
  • Maybe showing what you have already tried would be a good place to start. Also, this isn't a Classic ASP question - I've removed that from the tag list. – Paul May 05 '13 at 18:25

1 Answers1

0

can't you do this by FK_relations between datas? anyways what query or table structure you have will help us move on to the solution.

Alok
  • 808
  • 13
  • 40
  • possible duplicate of what is here http://stackoverflow.com/questions/5338519/traversing-a-tree-structure-using-recursion and here http://www.codeproject.com/Tips/447343/Traverse-a-MSSQL-table-without-using-CURSOR – Alok May 05 '13 at 18:25
  • for showing this data, you can use simple ul-li and call the data in <%%> in code blocks – Alok May 05 '13 at 18:31
  • i didnt do that its not working. sorting good but when want to do likes this kind of side menu – Kaan Kılıç May 05 '13 at 19:04
  • can you share some example of what you are actually trying to pull – Alok May 06 '13 at 07:31