473,324 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

database treeview

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
Nov 17 '05 #1
7 11080
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

Nov 17 '05 #2
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


Nov 17 '05 #3
anyone else who can help?
"Mike" wrote:
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

Nov 17 '05 #4
Mike,

In my opinion is almost the only way you can do this by going through the
datarows of your main datatable in an indexed for loop and add the nodes to
the treeview accoording to that.

If it is about a related data in your dataset than it has to be along with
the childrelations of a datarow that you are adding which has than its own
for index loop for the child nodes, and that going on as deep as your
relations are.

In my opinion is this quiet simple.

Don't forget to set the handlers after that you have populated the treeview
and not before.

I hope this helps,

Cor
Nov 17 '05 #5
If you are willing to have a look at a commercial solution then you
might want to consider Infralution's Virtual Tree. This provides a
very flexible data binding mechanism that allows you bind directly to
data from ADO.NET dataset. Unlike other attempts at tree databinding
it does not force you to put all your data in one table - so you can
use it for real world applications. One of the sample projects
illustrates binding to the Microsoft Northwind sample database (eg
Customers->Orders->Details).

You can find more information and download a fully functional
evaluation version at:
www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution

Nov 17 '05 #6
thx, it really looks nice, but i'm a student and workin on a project for my
diploma.

"Grant Frisken" wrote:
If you are willing to have a look at a commercial solution then you
might want to consider Infralution's Virtual Tree. This provides a
very flexible data binding mechanism that allows you bind directly to
data from ADO.NET dataset. Unlike other attempts at tree databinding
it does not force you to put all your data in one table - so you can
use it for real world applications. One of the sample projects
illustrates binding to the Microsoft Northwind sample database (eg
Customers->Orders->Details).

You can find more information and download a fully functional
evaluation version at:
www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution

Nov 17 '05 #7
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


Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Daniel K. | last post by:
How can I store TreeView in a database?? Preferably as Blob... But I don't know how to get the TreeView into the Blob.... Thanks in advance for your help! Daniel
0
by: Teemu | last post by:
Hello. Please bear with me if this seems like a basic question (I'm just getting started with all this ASP.NET and WebControls stuff). Anyway, I'm trying to programmatically build a...
0
by: Rob | last post by:
I want to feed the menu control from a database which is set up as WebPageID, WebPageParent, URL where the WebPage Id is the primary key and the WebpageParent is the foreign key. The menu will...
7
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made...
9
by: Marina | last post by:
Hello! I have a database with some customers. Each one of them has 3 other customers under him etc. (something like an MLM system). Now, I want to create a treeview with this. Eg. C1 C11...
18
by: BA | last post by:
Hello, Anyone know of an open source C# pure xml database that is available? I've done some looking around and can't locate anything. Thanks in advance, BA http://biztalkia.blogspot.com/
1
by: cjinsocal581 | last post by:
Hi all, I am struggling with the following: Environement: VB.NET 2005 TreeView Control SQL Database I need to be able to save a TreeView's nodes into a SQL database and then be able to call...
1
by: Medes | last post by:
Hi, I am trying to load my items from Database to a Treeview but i have faild My table contains id, parentId, nodeName like following: (1 , 1 RootNode) (2 , 2 , ParentNode)
0
by: Falcula | last post by:
Hello, I have a treeview that i fill from a database, when i update nodename in database the treeview dont update. Its works when iam not useing enableviewstate="true" but then i loosing the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.