Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) If Not Page.IsPostBack Then ' Set up connection and command to retrieve the Employees table Dim con As New SqlConnection("Data Source=.\sqlexpress;Initial Catalog=Northwind;Integrated Security=True") Dim com As New SqlCommand("SELECT EmployeeID, FirstName, LastName, Title, ReportsTo FROM EMPLOYEES", con) ' Set up a data adapter to fill up a dataset with data Dim da As New SqlDataAdapter(com) Dim employees As New DataSet() con.Open() ' Retrieve data da.Fill(employees, "Employees") con.Close() ' Set up data relation for the same table with the EmployeeID and ReportsTo columns Dim rel As New DataRelation("Employees", employees.Tables("Employees").Columns("EmployeeID"), employees.Tables("Employees").Columns("ReportsTo")) employees.Relations.Add(rel) ' Set the table's primary key field employees.Tables("Employees").PrimaryKey = New DataColumn() {employees.Tables("Employees").Columns("EmployeeID")} ' Store the data in Session state Me.Session("Employees") = employees Me.WebHierarchicalDataGrid2.IsSelfReference = True Me.WebHierarchicalDataGrid2.MaxDataBindDepth = 2 End If ' TODO: set up data binding End Sub