473,725 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11106
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**@discussio ns.microsoft.co m> wrote in message
news:92******** *************** ***********@mic rosoft.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**@discussio ns.microsoft.co m> wrote in message
news:92******** *************** ***********@mic rosoft.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_Selected IndexChanged : populates the tree with the contents of the
selected cd.

in newcd.cs form:
- saverecursiveda ta : 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**@discussio ns.microsoft.co m> wrote in message
news:29******** *************** ***********@mic rosoft.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**@discussio ns.microsoft.co m> wrote in message
news:92******** *************** ***********@mic rosoft.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
3380
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
1439
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 treeview based off a dataset that I've queried from our database. First, I'm manually creating and adding the "root" node to the treeview control. Then, I'm trying to iterate through my dataset and build all the folders and files under the root node.
0
1283
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 have multiple nodes. This example works in the treeview but I would really like to use the horizontal orientation of the menu control. I understand that I may lose the populate on command. Does anyone know how to populate the menu control with...
7
2836
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 of custom, extended nodes, which include all the extra information contained in the table and not just typical TreeNode objects. To do that, I first created a structure with all the extra
9
2098
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 C111 C1111 C1112 C1113
18
7432
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
18678
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 them from the Table back into the TreeView when the app starts up. (If the table is empty, then just exit the sub)
1
1580
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
1899
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 current selection and stuff in the tree. I post my code here, any idea ?
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.