Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Hierarchy in Treeview

Hierarchy in Treeview

Scheduled Pinned Locked Moved ASP.NET
help
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dj rock
    wrote on last edited by
    #1

    Hi guys I am stuck in one problem. I have table called folder. in that i am storing information of all folders that are made by users. i have one field in this table called parentfolderid. so by that i can store parent folder's id in my table so that i can have hierarchy of folders. Now my problem is that there can be sub folders in the folder so by following code i get value upto second level but if there is hierarchy like Root folder --> parent folder --> child folder --> grand child folder Then it will not handle in my code so if any one can help me i would be very pleased. --------CODE--------- Try dr = temp.ExecuteDataReader("Select * from Folder where ID = ParentFolderID") While dr.Read Dim tNode As New TreeNode tNode.Text = dr("Name") Root = dr("ID") Tree1.Nodes.Add(tNode) Try dr1 = dbaccess.ExecuteDataReader("Select * from Folder where ID <> ParentFolderID and ParentFolderID = '" & Root.ToString & "'") While dr1.Read Dim tChileNode1 As New TreeNode() tChileNode1.Text = dr1("Name") tNode.ChildNodes.Add(tChileNode1) End While Catch ex As Exception Finally dr1.Close() End Try End While Catch ex As Exception MsgBox(ex.Message) Finally dr.Close() End Try Please help me:(

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups