Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

TreeView Questions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rhaazy - 22 Jun 2006 15:05 GMT
Using VS2003 form.Treeview class

I need to populate a treeview using three tables in my database.

tblOrgSystems looks like this:

OrgSystemID                     OrgSystem
    1                         N. America
    2                         Canada

tblOrgSystemNodes looks like this:

OrgSystemID                            OrgNode ID          OrgNode
     1                          3                          Manistique
     1                          4                          Houston
     1                          7                          M.Sales
     1                          8                          M.IT
     1                          9                          M.HR
     1                          10                        H.Sales
     1                           11                       H.IT
     1                           12                       H.HR
     2                           5                        Toronto
     2                           6                        Ontario
     2                           13                      T.Sales
etc.....

tblOrgSystemNodeParent looks like this:

OrgSystemID                         OrgNodeID          OrgNodeParentID
    1                             1                             1
    1                              3                             1
    1                              4                             1
    1                              7                             3
    1                               8                            3
    1                               9                            3
    2                               2                            2
    2                               5                            2
   2                                 6                           2
  2                                 13                          5
  2                                  14                         5
  2                                  15                         5
etc......

My root nodes are the OrgSystems, that part is easy.  But my second
select statement must populate nodes based on this parent child
relationship.  It should look at the OrgNodeID of the parent node and
know what to populate it with based on the info in
tblOrgSystemNodeParent.  So far this is what I have for a select
statement, I know I'm on the right track but I'm missing something, any
help would be great.

string select = "select OrgNode, tblOrgSystemNode.OrgNodeID from
tblOrgSystemNode JOIN tblOrgSystemNodeParent ON
tblOrgSystemNode.OrgNodeID = tblOrgSystemNodeParent.OrgNodeID where
tblOrgSystemNodeParent.OrgNodeParentID = '" +
OrgSystemID[treeView1.SelectedNode.Index] + "'";
Eric Moreau - 23 Jun 2006 14:43 GMT
See an article I wrote in April 2006 from http://emoreau.s2i.com/

You will find that I open 2 distinct datatables and I set relations between
them.

Signature

HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
S2i web inc. (www.s2i.com)
http://emoreau.s2i.com/

> Using VS2003 form.Treeview class
>
[quoted text clipped - 52 lines]
> tblOrgSystemNodeParent.OrgNodeParentID = '" +
> OrgSystemID[treeView1.SelectedNode.Index] + "'";

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.