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