C# - Treeview data into a Table SQL Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Radicaly2k
    New Member
    • Sep 2007
    • 2

    C# - Treeview data into a Table SQL Server

    I would like to know how can I take the nodes of a treeview and store them into a SQL Server table so I can then visualize them in a DataGridView. Also I would like to store the information in a Xpath way.

    Thanks

    Christopher M. Contreras
  • vanc
    Recognized Expert New Member
    • Mar 2007
    • 211

    #2
    Originally posted by Radicaly2k
    I would like to know how can I take the nodes of a treeview and store them into a SQL Server table so I can then visualize them in a DataGridView. Also I would like to store the information in a Xpath way.

    Thanks

    Christopher M. Contreras
    So the idea should be like....you create a node table which contains all information about TreeNode, of course you can't store events. Then you start from the RootNode to the very end node and create nodes in node table.
    Or if you just need to visualize them in DataGridView, you actually don't have to store nodes in database. But the best way to do it is to store the node object in database which is I don't know how to do hehe.... maybe in OO database???

    cheers.

    Comment

    • Radicaly2k
      New Member
      • Sep 2007
      • 2

      #3
      Originally posted by vanc
      So the idea should be like....you create a node table which contains all information about TreeNode, of course you can't store events. Then you start from the RootNode to the very end node and create nodes in node table.
      Or if you just need to visualize them in DataGridView, you actually don't have to store nodes in database. But the best way to do it is to store the node object in database which is I don't know how to do hehe.... maybe in OO database???

      cheers.
      How can I just represent the treeview int a datagridview, and I will also like if it is possible to represent in the Datagridview in a Xpath form.

      Comment

      • vanc
        Recognized Expert New Member
        • Mar 2007
        • 211

        #4
        Originally posted by Radicaly2k
        How can I just represent the treeview int a datagridview, and I will also like if it is possible to represent in the Datagridview in a Xpath form.
        Basically, DataGridView is a view like database table, so you have to create rows and columns to reflect values of a TreeNode, such as Name, Value, etc.

        for eg: Name Value Index
        firstnode 123 0
        secnode 234 1

        About Xpath, I don't remember about this part, give me time to recall the memory belong.

        cheers.

        Comment

        Working...