Hierarchical listings

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Hierarchical listings

    I have need to show a list of areas indented hierarchically on an ASP web
    page like the following example.

    The World
    Europe
    United Kingdom
    England
    Wales
    Scotland
    Northern Ireland
    France
    Germany
    The Americas
    North America
    State 1
    State 2
    South America
    Columbia
    ...



    The data is held in a database table which has 3 fields (areaID, area,
    subAreaOf). The data from the above example would be as follows.

    areaID area subAreaOf
    1 The World
    2 Europe 1
    3 United Kingdom 2
    4 England 3
    5 Scotland 3
    6 Wales 3
    ......You get the idea...

    Any idea how to generate the indented listings as economically as possible
    on the queries.

    Thanks,

    Sam


    Sam Churchill Guest

  2. Similar Questions and Discussions

    1. TV Listings Module
      Does anyone have any experience in developing a TV lisings module similar to what is on Yahoo! TV or on the TV Guide home page. Something that is...
    2. How to supress directory listings?
      When you enter a URL into the browser (not a .cfm file, for example), it lists the various files and directories. Using Apache, there's a file...
    3. web designer directory - free listings
      hi. www.labelsound.com now has free listings for web designers, graphic designers and photographers. We're a music licensing site who provide music...
    4. Directory listings
      Hey guys, I'm really new to the wole php thing, have never even touched it before and have been looking through php.net, and what i am basically...
    5. Error code listings
      Is there a published list of IFS error codes available somewhere online? I get the occastional one and have no way of finding out what it means. ...
  3. #2

    Default Hierarchical listings

    I have need to show a list of areas indented hierarchically on an ASP web
    page like the following example.

    The World
    Europe
    United Kingdom
    England
    Wales
    Scotland
    Northern Ireland
    France
    Germany
    The Americas
    North America
    State 1
    State 2
    South America
    Columbia
    ...



    The data is held in a database table which has 3 fields (areaID, area,
    subAreaOf). The data from the above example would be as follows.

    areaID area subAreaOf
    1 The World
    2 Europe 1
    3 United Kingdom 2
    4 England 3
    5 Scotland 3
    6 Wales 3
    ......You get the idea...

    Any idea how to generate the indented listings as economically as possible
    on the queries.

    Thanks,

    Sam



    Sam Churchill Guest

  4. #3

    Default Re: Hierarchical listings

    hi sam,

    here are some good lnks to solve your puzzle

    [url]http://www.intelligententerprise.com/001020/celko1_1.shtml[/url] --- Nested sets
    [url]http://www.dbazine.com/tropashko4.html[/url]
    [url]http://vyaskn.tripod.com/hierarchies_in_sql_server_databases.htm[/url] ------
    -------------excellent
    [url]http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B248915[/url]
    [url]http://tinyurl.com/c17l[/url]
    [url]http://www.yafla.com/papers/sqlhierarchies/sqlhierarchies.htm[/url]

    If you are using SQL server and deciede to get these values with recursion
    you will hit the 32 limit (i belive there are more countries that this in
    the world:) )

    The solution would probabally be to use a language that doesn't have this
    barrier,

    alternatvly joe celko's nested sets (first link above) is excellent if you
    can get you head around it, and achive inserts, updates, deletes..

    cheers

    martin.

    "Sam Churchill" <ngs@samchurchill.co.uk> wrote in message
    news:Nf0Ra.48096$9C6.2542073@wards.force9.net...
    > I have need to show a list of areas indented hierarchically on an ASP web
    > page like the following example.
    >
    > The World
    > Europe
    > United Kingdom
    > England
    > Wales
    > Scotland
    > Northern Ireland
    > France
    > Germany
    > The Americas
    > North America
    > State 1
    > State 2
    > South America
    > Columbia
    > ...
    >
    >
    >
    > The data is held in a database table which has 3 fields (areaID, area,
    > subAreaOf). The data from the above example would be as follows.
    >
    > areaID area subAreaOf
    > 1 The World
    > 2 Europe 1
    > 3 United Kingdom 2
    > 4 England 3
    > 5 Scotland 3
    > 6 Wales 3
    > .....You get the idea...
    >
    > Any idea how to generate the indented listings as economically as possible
    > on the queries.
    >
    > Thanks,
    >
    > Sam
    >
    >
    >

    martin de vroom Guest

  5. #4

    Default Re: Hierarchical listings

    Sam,

    While I don't have the exact code, you might want to look at some recursive
    code. Perhaps a code on threaded discussions should help you.

    --
    Manohar Kamath
    Editor, .netBooks
    [url]www.dotnetbooks.com[/url]


    "Sam Churchill" <ngs@samchurchill.co.uk> wrote in message
    news:D40Ra.48094$9C6.2541778@wards.force9.net...
    > I have need to show a list of areas indented hierarchically on an ASP web
    > page like the following example.
    >
    > The World
    > Europe
    > United Kingdom
    > England
    > Wales
    > Scotland
    > Northern Ireland
    > France
    > Germany
    > The Americas
    > North America
    > State 1
    > State 2
    > South America
    > Columbia
    > ...
    >
    >
    >
    > The data is held in a database table which has 3 fields (areaID, area,
    > subAreaOf). The data from the above example would be as follows.
    >
    > areaID area subAreaOf
    > 1 The World
    > 2 Europe 1
    > 3 United Kingdom 2
    > 4 England 3
    > 5 Scotland 3
    > 6 Wales 3
    > .....You get the idea...
    >
    > Any idea how to generate the indented listings as economically as possible
    > on the queries.
    >
    > Thanks,
    >
    > Sam
    >
    >

    Manohar Kamath [MVP] Guest

  6. #5

    Default Re: Hierarchical listings

    my tree code does exactly what your asking for:
    [url]http://www.braincast.nl/?deeplink=dhtml/asptree[/url]

    click view and look at the 'simple' version, you can download
    a zip file with all the samples...

    [url]http://www.braincast.nl/dhtml/asptree/files/tree.asp[/url]


    "Sam Churchill" <ngs@samchurchill.co.uk> wrote in message
    news:D40Ra.48094$9C6.2541778@wards.force9.net...
    > I have need to show a list of areas indented hierarchically on an ASP web
    > page like the following example.
    >
    > The World
    > Europe
    > United Kingdom
    > England
    > Wales
    > Scotland
    > Northern Ireland
    > France
    > Germany
    > The Americas
    > North America
    > State 1
    > State 2
    > South America
    > Columbia
    > ...
    >
    >
    >
    > The data is held in a database table which has 3 fields (areaID, area,
    > subAreaOf). The data from the above example would be as follows.
    >
    > areaID area subAreaOf
    > 1 The World
    > 2 Europe 1
    > 3 United Kingdom 2
    > 4 England 3
    > 5 Scotland 3
    > 6 Wales 3
    > .....You get the idea...
    >
    > Any idea how to generate the indented listings as economically as possible
    > on the queries.
    >
    > Thanks,
    >
    > Sam
    >
    >

    Marc Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139