473,799 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trees? Subprojects? Threads? Or How do I sort multiple levels of nested relations?

Hi all,

I'm not sure exactly what words to use or how to Google this. (I keep
coming up with BOL links.) So, I'm going to ask the group for a
starting point or proper terms to even describe what I'm doing. Is
this a "thread handler? Or a "hierarchy tree" or what?

-----------------------
Basically, I'm working on a project that will be a task and project
tracking tool. What I've been asked to do is provide functionality
for two things at a Manager level.
1. Radar lists
2. sub projects.

Both of them involve the possibility of having a
1. Project
1.A Subproject
1.A.i. Sub-sub-project
....to infinity.
1.B Subproject b
1.B.i Sub-sub project b.

I'd like to be able to sort them out like Windows Explorer does
directories. Or like a usenet reader or a blog site handles threads.

I know to relate the table to itself by having a table structure
like...
ProjectID
ProjectTitle
ParentProjectID

Where ParentProjectID is another ProjectID in the list. i.e. The
example I typed above would be something like this...
1, Project, null
2, Subproject, 1
3, sub-sub-project, 2
4, subproject b, 1
5, sub-sub-project b, 4

But, I haven't been able to figure out a method for queries that
somehow discerns what is a top level, second level, third level, etc
item for the purposes of queries and reports.

-------
Anyway, I assume this is a standard method for database writers that
has a standard name. So, if anyone can let me in on that, I'd
appreciate it so I can start learning! :)

Many TIA,

Jon

Feb 21 '07 #1
3 1842
On Feb 21, 5:39 pm, "jonceramic " <joncera...@gma il.comwrote:
Hi all,

I'm not sure exactly what words to use or how to Google this. (I keep
coming up with BOL links.) So, I'm going to ask the group for a
starting point or proper terms to even describe what I'm doing. Is
this a "thread handler? Or a "hierarchy tree" or what?

-----------------------
Basically, I'm working on a project that will be a task and project
tracking tool. What I've been asked to do is provide functionality
for two things at a Manager level.
1. Radar lists
2. sub projects.

Both of them involve the possibility of having a
1. Project
1.A Subproject
1.A.i. Sub-sub-project
...to infinity.
1.B Subproject b
1.B.i Sub-sub project b.

I'd like to be able to sort them out like Windows Explorer does
directories. Or like a usenet reader or a blog site handles threads.

I know to relate the table to itself by having a table structure
like...
ProjectID
ProjectTitle
ParentProjectID

Where ParentProjectID is another ProjectID in the list. i.e. The
example I typed above would be something like this...
1, Project, null
2, Subproject, 1
3, sub-sub-project, 2
4, subproject b, 1
5, sub-sub-project b, 4

But, I haven't been able to figure out a method for queries that
somehow discerns what is a top level, second level, third level, etc
item for the purposes of queries and reports.

-------
Anyway, I assume this is a standard method for database writers that
has a standard name. So, if anyone can let me in on that, I'd
appreciate it so I can start learning! :)

Many TIA,

Jon

I think you are talking about two different things, a datasource or
recordset and a method to present it. The control that Windows
explorer uses is called a TreeView control and is usually used with a
ListView control or something similar to display related objects or
information. They are not directly connected to a set of data so it
will require some extra patience to implement. You should spend a good
amount of time learning about these two controls before attacking the
recordset part of it as the methods to present it may influence how
you gather the data.

If they are not outlined in Access help, then check the MSDN site.
There should be a fair amount of info there.

Feb 21 '07 #2
Look up "Nested Sets" and "Adjacency Model". These are the two major
styles. The one that you are working on is called the Adjacencty
Model.

In browsing through these you see lots of nonsense about whether A or
B is normalised or not.

Main Difference:
Adjacency Model - easy to update, slow to query (must use recursion)
Nested Sets - easy to query (simple SQL), must update half of
recordset for every update.

I'm still waiting to find out how to represent a "forest" in a nested
set model.

Cheers,
Jason Lepack

On Feb 21, 5:39 pm, "jonceramic " <joncera...@gma il.comwrote:
Hi all,

I'm not sure exactly what words to use or how to Google this. (I keep
coming up with BOL links.) So, I'm going to ask the group for a
starting point or proper terms to even describe what I'm doing. Is
this a "thread handler? Or a "hierarchy tree" or what?

-----------------------
Basically, I'm working on a project that will be a task and project
tracking tool. What I've been asked to do is provide functionality
for two things at a Manager level.
1. Radar lists
2. sub projects.

Both of them involve the possibility of having a
1. Project
1.A Subproject
1.A.i. Sub-sub-project
...to infinity.
1.B Subproject b
1.B.i Sub-sub project b.

I'd like to be able to sort them out like Windows Explorer does
directories. Or like a usenet reader or a blog site handles threads.

I know to relate the table to itself by having a table structure
like...
ProjectID
ProjectTitle
ParentProjectID

Where ParentProjectID is another ProjectID in the list. i.e. The
example I typed above would be something like this...
1, Project, null
2, Subproject, 1
3, sub-sub-project, 2
4, subproject b, 1
5, sub-sub-project b, 4

But, I haven't been able to figure out a method for queries that
somehow discerns what is a top level, second level, third level, etc
item for the purposes of queries and reports.

-------
Anyway, I assume this is a standard method for database writers that
has a standard name. So, if anyone can let me in on that, I'd
appreciate it so I can start learning! :)

Many TIA,

Jon

Feb 21 '07 #3
On Feb 21, 4:57 pm, "Jason Lepack" <jlep...@gmail. comwrote:
Look up "Nested Sets" and "Adjacency Model". These are the two major
styles. The one that you are working on is called the Adjacencty
Model.

In browsing through these you see lots of nonsense about whether A or
B is normalised or not.

Main Difference:
Adjacency Model - easy to update, slow to query (must use recursion)
Nested Sets - easy to query (simple SQL), must update half of
recordset for every update.

I'm still waiting to find out how to represent a "forest" in a nested
set model.

Cheers,
Jason Lepack

On Feb 21, 5:39 pm, "jonceramic " <joncera...@gma il.comwrote:
Hi all,
I'm not sure exactly what words to use or how to Google this. (I keep
coming up with BOL links.) So, I'm going to ask the group for a
starting point or proper terms to even describe what I'm doing. Is
this a "thread handler? Or a "hierarchy tree" or what?
-----------------------
Basically, I'm working on a project that will be a task and project
tracking tool. What I've been asked to do is provide functionality
for two things at a Manager level.
1. Radar lists
2. sub projects.
Both of them involve the possibility of having a
1. Project
1.A Subproject
1.A.i. Sub-sub-project
...to infinity.
1.B Subproject b
1.B.i Sub-sub project b.
I'd like to be able to sort them out like Windows Explorer does
directories. Or like a usenet reader or a blog site handles threads.
I know to relate the table to itself by having a table structure
like...
ProjectID
ProjectTitle
ParentProjectID
Where ParentProjectID is another ProjectID in the list. i.e. The
example I typed above would be something like this...
1, Project, null
2, Subproject, 1
3, sub-sub-project, 2
4, subproject b, 1
5, sub-sub-project b, 4
But, I haven't been able to figure out a method for queries that
somehow discerns what is a top level, second level, third level, etc
item for the purposes of queries and reports.
-------
Anyway, I assume this is a standard method for database writers that
has a standard name. So, if anyone can let me in on that, I'd
appreciate it so I can start learning! :)
Many TIA,
Jon- Hide quoted text -

- Show quoted text -
Jason and Storrboy... Thank you, this is exactly what I needed.
Searching for these terms (treeview, listview, netsted sets, and
adjacency model) gets me copious examples of code and theory for how
to set things up. many thanks. Jon
Feb 21 '07 #4

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

Similar topics

0
1302
by: Paul Arnold | last post by:
We are currently in the process of developing a client/server based generic tree application with which we want to be able to model and render any size, shape and depth of tree. Our primary objective is to provide the ability to model large data trees with some 20 million+ nodes whilst still allowing adequate rendering and query times from the client. We have just bought Joe Celko's "Tree's and Hierarchies in SQL fo Smarties" and have...
6
636
by: JC | last post by:
Hi, I'm looking for some help on Binary trees, in particular levels, heights etc. I need to find the levels of a tree, I also need to determine the minimum, maximum and average leaf levels. Any help would be greatly appreciated... Thank you,
0
2055
by: Chi | last post by:
This is a problem that has been nagging me for a while, and I cannot figure out how to best solve the problem: I have a stored procedure that returns multi-level "nested" XML and inline XDR. My goal is to have a .NET application read the XML into a DataSet using the inline schema, and the relations automatically created according to the nesting of the elements. My query in the stored procedure looks similar to this:
0
1016
by: Raed Sawalha | last post by:
I have the following code where Build the relation on DataSet Schema I got the error that Child Has Multiple Tables DataTable LoData = new DataTable("LearningOutcomesDT"); DataTable LoDocData = new DataTable("LearningOutcomesDocDT"); da = new SqlDataAdapter(BuildSQLQuery(BookId,queryType.LOBook),oSql); da.Fill(LoData); ds.Tables.Add(LoData); da = new SqlDataAdapter(BuildSQLQuery(BookId,queryType.LODoc),oSql);
3
1964
by: Bryan Christopher | last post by:
Hello All! I have a rather abstract question for some genius out there to answer. I want to integrate communication tracking, for customer relations, into an existing Access DB. What I was going for is this... tblCommunications trxCommunicationThreads ----------------- ----------------------- CommunicationID (PK) CommID1 (FK1)(PK) ContactID (FK from contact table) CommID2...
0
983
by: Ron | last post by:
I am trying to create a nested DataList with multiple subcategories listed under each primary category. Unfortunately, I end up with a bunch of multiple SubCategory values after iterating through the loop. My code is as follows: //**************************************************************** for(int i=0;i<=cat.Count-1;i++) {
0
1447
by: George Durzi | last post by:
I have a DataSet with 3 tables, and two DataRelations dsSubs.Tables.TableName = "Subscriptions" dsSubs.Tables.TableName = "AccountManagers" dsSubs.Relations.Add "AccountManagers_Subscriptions", dsSubs.Tables.Columns dsSubs.Tables.Columns) dsSubs.Tables.TableName = "NewsFeeds"
3
4043
by: Eirik Eldorsen | last post by:
Im trying to make a nested repeater with 3 levels. I've successfully created a nested repeater with 2 levels, but when adding the 3rd level I get an InvalidCastException. What am I doing wrong? Here is my code: <asp:Repeater id="level1Repeater" runat="server"> <itemtemplate>
7
1499
by: jefftyzzer | last post by:
Friends: In a DB2 UDB LUW table, I have a table with pairs of equivalent ID's. What I want to do is assign all equivalent IDs to the same group number, including those that are transitively related, i.e., if A = B and B = C then A = C, so I'd group all three together. Although they're not related in a composition fashion per se, it seems like the way to go conceptually is to consider the ID relationships as a reporting tree (ID_A...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
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
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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...
0
6811
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
5469
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...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
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.