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. General Programming
  3. C#
  4. save a TreeView in database [modified]

save a TreeView in database [modified]

Scheduled Pinned Locked Moved C#
questiondatabaseperformance
4 Posts 4 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.
  • R Offline
    R Offline
    reza assar
    wrote on last edited by
    #1

    i want to save a TreeView in database i designed a table with three fields (ID , NodeName,UpareNodeID) and create a relation ship with ID and UpareNodeID is it correct? if it is , how can i retrieve thees nodes with the best performance ? i want to know if there is a better solution to save and retrieve this kind of collection thanks!

    modified on Monday, May 10, 2010 12:08 PM

    M P A 3 Replies Last reply
    0
    • R reza assar

      i want to save a TreeView in database i designed a table with three fields (ID , NodeName,UpareNodeID) and create a relation ship with ID and UpareNodeID is it correct? if it is , how can i retrieve thees nodes with the best performance ? i want to know if there is a better solution to save and retrieve this kind of collection thanks!

      modified on Monday, May 10, 2010 12:08 PM

      M Offline
      M Offline
      Michel Godfroid
      wrote on last edited by
      #2

      SQL Server 2008 has a hierachy[^] data type

      1 Reply Last reply
      0
      • R reza assar

        i want to save a TreeView in database i designed a table with three fields (ID , NodeName,UpareNodeID) and create a relation ship with ID and UpareNodeID is it correct? if it is , how can i retrieve thees nodes with the best performance ? i want to know if there is a better solution to save and retrieve this kind of collection thanks!

        modified on Monday, May 10, 2010 12:08 PM

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        Where you are retrieving the data to populate the treeview, you should look at lazy loading it. In other words, if you have a deep hierarchy with lots of records, you can improve the responsiveness of your application and the overall feel for your users just by loading data as it's needed.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        1 Reply Last reply
        0
        • R reza assar

          i want to save a TreeView in database i designed a table with three fields (ID , NodeName,UpareNodeID) and create a relation ship with ID and UpareNodeID is it correct? if it is , how can i retrieve thees nodes with the best performance ? i want to know if there is a better solution to save and retrieve this kind of collection thanks!

          modified on Monday, May 10, 2010 12:08 PM

          A Offline
          A Offline
          Alex Manolescu
          wrote on last edited by
          #4

          You may use XML for this with succes! :) Give it a try. Good luck!

          Alex Manolescu

          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