Treeview from SQL Table
I have looked through a few SQL hierarchy tutorials, but none of them made much sense for my application. Perhaps I am just not understanding them correctly. I'm writing a C# ASP.NET application and I would like to create a tree view hierarchy from SQL data.
This is how the hierarchy would work:
If the ID and Location ID are the same, this would determine the top Parent. Any Children of that Parent would have the same Location ID as the Parent. Any Grandchildren of that Child would have a Location ID equal to the ID of the Child, and so on.
ID | Location ID | Name
_______| __________ |_____________
1331 | 1331 | House
1321 | 1331 | Room
2141 | 1321 | Bed
1251 | 2231 | Gym
For the above example:
Any help or direction to easy to follow tutorials would be greatly appreciated.