Query for .net navigation menu / treeview
I'm drawing a blank here and I am hoping someone can point me in the right direction. I have a table with the following columns (some omitted)
ID
GUID
PageName
ParentPageID
I want to build a hierarchical navigation system (2-tier). The conceptual problem that I am running into was getting this information from the same table. Initially I was going to use a nested repeater but I am thinking a treeview would be better. Anyway, the problem is the query. How would I start with something like this? Let's use the following as an example
Rows
(ID '1', GUID '888...', PageName 'Page A', ParentPageID '-1')
(ID '2', GUID '111...', PageName 'Page B', ParentPageID '-1')
(ID '3', GUID '222...', PageName 'Page C', ParentPageID '-1')
(ID '4', GUID '375...', PageName 'Page 1', ParentPageID '1')
(ID '5', GUID '562...', PageName 'Page 2', ParentPageID '1')
(ID '6', GUID '874...', PageName 'Page 3', ParentPageID '2')
(ID '7', GUID '388...', PageName 'Page 4', ParentPageID '3')
So, I want to be able to build a query so that I can do the following
Page A
Page 1
Page 2
Page B
Page 3
Page C
Page 4
Any help would be greatly appreciated. Thanks!

