Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kirknew2SQL
Posting Yak Master
194 Posts |
Posted - 2007-10-17 : 14:28:36
|
| If this is not the right place to ask this question maybe some one can direct me to a URLI have a SQL 2005 table containing this data. I need to use this data to populate a Windows form tree view. Does any one have or know where i can find some code that will do this?The unusual thing is a child may be it's own parent. See 15.I have not been ablr to find anythibng and I am at a complete loss. Any help you can give would be greatly appreciated.Thank youChild...Parent...Depth.....Hierarchy1.........NULL.....0..........012..........1.......1..........01.025..........2.......2..........01.02.056..........2.......2..........01.02.063..........1.......1..........01.037..........3.......2..........01.03.0711.........7.......3..........01.03.07.1114.........11......4..........01.03.07.11.1412.........7.......3..........01.03.07.1213.........7.......3..........01.03.07.138..........3.......2..........01.03.089..........3.......2..........01.03.094..........1.......1..........01.0410.........4.......2..........01.04.1015.........NULL....0..........1515.........15......1..........15.1516.........15......1..........15.1618.........16......2..........15.16.1817.........15......1..........15.17 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2007-10-17 : 15:02:04
|
| You should probably have posted this question in the Transact SQL 2000/2005 forum but nevertheless you'll find some pretty good info by searching for "tree" in the google-search in the top right corner of the website or maybe by looking here, the bottom of the article seems to suit your needs quite good: http://www.sqlteam.com/article/more-trees-hierarchies-in-sql--Lumbago"Real programmers don't document, if it was hard to write it should be hard to understand" |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-10-17 : 16:11:37
|
| moved from script library._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
kirknew2SQL
Posting Yak Master
194 Posts |
Posted - 2007-10-17 : 18:34:50
|
| The URL http://www.sqlteam.com/article/more-trees-hierarchies-in-sql is a good artical showing how to set up and populate the table. But not how to put the data into a tree view.Any one have any suggestions how to populate a treeview given the data in the original post? |
 |
|
|
|
|
|