Create The SQL Table {tblTree}:
ID {Unique ID Identity Seed}
ParentID {bigint}
Name{varchar(50)}
Create Stored Procedure {spGenerateTree}
CREATE PROCEDURE spGenerateTree
@lookupid bigint
AS
BEGIN
WITH CTE(name, id, parentid) AS
(
SELECT name, childid, parentid from tblTree where id=@lookupid
UNION ALL
SELECT tree.name, tree.id, tree.parentid
from tblTree tree
INNER JOIN CTE c ON tree.ID = c.parentid
)
SELECT * FROM CTE
END
Populate tblTree with your Tree Data and voila at execution of the PROC you will have a nested iHierarchal Dataset directly from SQL that you can use in your C# ASP.NET Page.