I am binding active directory entries into my asp.net treeview control but not able to achieve it completely. I want to bind the AD entries into my treeview as it looks like same as in the Active Directory tree hierarchy. 

I can able to bind the Main OUs but I am not able to bind its child of child and also some of the Ou's children may have children and some of them or not having any children.

I am not sure about the last end so I am not sure about the for loop count, it may goes like below, 

```
A

|__A1

   |__A11

      |_A111

        |_...
B

|__B1

|__B2

C

 |__C1

    |__C11

```

So In this case, How can i construct my treeview to get these structure of active directory? I dont know how to proceed this with for loop. Please help me to achieve this structure on my treeview1.

Here is My code:

```
DirectoryEntry ADentry = new DirectoryEntry("LDAP://10.36.6.163/DC=server,DC=local", AD.LDAPUser, AD.Password, AuthenticationTypes.Secure);

    DirectorySearcher Searcher = new DirectorySearcher(ADentry);
    Searcher.Filter = ("(objectClass=organizationalUnit)");
    foreach (DirectoryEntry firstChild in ADentry.Children)
    {
        if (firstChild.Name.Contains("OU"))
        {
            TreeNode Node = new TreeNode(firstChild.Name.Remove(0,3));
            TreeView1.Nodes.Add(Node);

            foreach (DirectoryEntry secondchild in firstChild.Children)
            {

                TreeNode childNode=new TreeNode(secondchild.Name.Remove(0,3));
                Node.ChildNodes.Add(childNode);

                if (secondchild.Children != null)
                {
                    ??????
                }
            }
        }
    }

```

By using this code I can able to bind main OUs of root node only as mentioned below, not able to get its child of child. Need to bind the nodes the corresponding child with corresponding parents.

```
A
B
C

```