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. Populate treeview from database

Populate treeview from database

Scheduled Pinned Locked Moved C#
questioncsharpdatabasexmltutorial
6 Posts 3 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.
  • G Offline
    G Offline
    GermanDM
    wrote on last edited by
    #1

    Hi, Ok my database sheme I use is XML, i am trying to populate the data in a treeview control but it gives me unhappy results. Would it be easier or better by using an Access database rather than XML? ok ine more question sorry, i have seen many times before a couple of application that store information in a file where they have their own extension. for example storing information in a file database like databse1.dat or smth. How do people do this or is this not C# at all? Thanks guys Regards

    C 1 Reply Last reply
    0
    • G GermanDM

      Hi, Ok my database sheme I use is XML, i am trying to populate the data in a treeview control but it gives me unhappy results. Would it be easier or better by using an Access database rather than XML? ok ine more question sorry, i have seen many times before a couple of application that store information in a file where they have their own extension. for example storing information in a file database like databse1.dat or smth. How do people do this or is this not C# at all? Thanks guys Regards

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If you use the System.IO namespace to writ binary data, you can write any byte sequence you want, and call it whatever you like. I doubt that moving to Access will, by itself, change how the tree control behaves.

      Christian Graus - C++ MVP

      G 1 Reply Last reply
      0
      • C Christian Graus

        If you use the System.IO namespace to writ binary data, you can write any byte sequence you want, and call it whatever you like. I doubt that moving to Access will, by itself, change how the tree control behaves.

        Christian Graus - C++ MVP

        G Offline
        G Offline
        GermanDM
        wrote on last edited by
        #3

        Hi, Thanks for the reply, ok im using a binary file now to store my data and it writes perfect. but i have a problem with reading the data. basically every line in the dat file is one record. how can i read only a specific line and retrieve those values? Is it possible to populate a treeview control from a .dat binary file? Thanks

        M 1 Reply Last reply
        0
        • G GermanDM

          Hi, Thanks for the reply, ok im using a binary file now to store my data and it writes perfect. but i have a problem with reading the data. basically every line in the dat file is one record. how can i read only a specific line and retrieve those values? Is it possible to populate a treeview control from a .dat binary file? Thanks

          M Offline
          M Offline
          Mike Bluett
          wrote on last edited by
          #4

          You could tag the line with some string that you are pretty sure will be unique and then process the file line by line looking for that unique string. When it finds the line, parse the line into whatever format you require.

          G 1 Reply Last reply
          0
          • M Mike Bluett

            You could tag the line with some string that you are pretty sure will be unique and then process the file line by line looking for that unique string. When it finds the line, parse the line into whatever format you require.

            G Offline
            G Offline
            GermanDM
            wrote on last edited by
            #5

            that wouldnt work really because i use a binary file not a text file so you cannot process line by line. i have changed my mind am gonna stick with xml its alot better :) thanks for ur helps guys did learn alot though yay

            M 1 Reply Last reply
            0
            • G GermanDM

              that wouldnt work really because i use a binary file not a text file so you cannot process line by line. i have changed my mind am gonna stick with xml its alot better :) thanks for ur helps guys did learn alot though yay

              M Offline
              M Offline
              Mike Bluett
              wrote on last edited by
              #6

              It shouldn't matter whether the file is binary or not. When you read the file into memory it has to be parsed into a non-binary format in order for it's elements to be used by the program that is reading it.

              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