Hi,
about the sample I sent u: (The code is all in vs2k5 beta 2, if you want to
run in 2k3, than all you'll have to do is copy and past the right code)
I burn a lot of cds of my personal data and the things that I download from
net. But I used to lost track of whats on what cd. If I need the file1 than
what cd is it on? So I wrote this application to help me keep track of where
my data is. If I need something I simply search for it through this
application and it tells me what cd has that file.
Its simple to use. Once you make sure that the app is connecting fine with
the db. You select New CD from File menu. On the new form you locate the
folder whose contents you wanna save to db. It can be any folder, I always
locate my cd drive and click ok. Now from Options menu you select "Read CD".
All contents of the folder are displayed in the treeview. Once you see and
confirm all the data, type the CD Name that you want the tree data to be
known with in the textbox, than you can click "Save Data" and your data will
be saved to db. Once the mouse starts responding you can close the Form.
The CDs are loaded at the form startup in the main form. You can also
refresh Cds with File->Refresh CDs. As soon as you select any cd from the
drop down, its contents will be displayed in the tree.
I dont know how good r u at recursion, but mostly all the code uses
recursion due to the nature of the work.
Main functions are :
- popcd() : populates cds in the combo
- cmbcds_SelectedIndexChanged : populates the tree with the contents of the
selected cd.
in newcd.cs form:
- saverecursivedata : for saving tree contents to the db.
Since you were concerned about how easy my code will be to understand. I
cant guarantee but I can suggest that you start simple, ie, just create a
very simple directory tree structure on your hardrive, not more than three
nested folders and see the code executing through stepping-in inside the
debugger. First observe the the data being saved and the watch how the data
gets populated in the tree view.
Ask any questions that you may have.
(I have sent u the db script for the db as well. And ignore the imagelist
indexes code, its not working anyway)
Ab.
http://joehacker.blogspot.com
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
Hi,
well it depends on how easy it is for me to understand your code ;)
but i would appreciate if you mail it to sp********@aon.at.
thank you so far!
Mike
"Abubakar" wrote:
Hi,
I wrote an application that stores the tree hierarchy of directories to
database. It can than read that information from database table and
populate it back in a tree view. You can save any number of trees in the table.
If I email it to u, will that be helpful? I have it at home and I can email
it tomorrow.
Ab.
http://joehacker.blogspot.com
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com... hi everyone!
i'm searching for a tutorial or an example for how to fill a treeview
with information from my ms sql database. i've found some on "code project"
and other sites, but nothing like a real tutorial for beginners.
does anyone knows some helpflul links or can give me a short intro? my
treeview should act like a navigator or explorer-like, so that a click
on a node shows some detailed information on the right side of my win app.
i'm using VS 2005 beta and SQL server 2005 beta ... thx!
Mike