dataset recursion

Results 1 to 2 of 2

Thread: dataset recursion

  1. #1
    Join Date
    Dec 1969

    Default dataset recursion

    I have an access DB table that is used to set up a parent/child hierarchy. A child is identified becasue its parent ID = the Item ID of another row. The top level is identified by a zero parent ID. <BR>Parent ID &#124 Item ID<BR>0 &#124 1<BR>0 &#124 2<BR>0 &#124 3<BR>1 &#124 27<BR>1 &#124 4<BR>2 &#124 6<BR>3 &#124 31<BR>3 &#124 25<BR>3 &#124 12<BR>4 &#124 13<BR>6 &#124 20<BR>31 &#124 33<BR>31 &#124 32<BR>12 &#124 28<BR><BR>I can get a dataset that includes all of this data. What I would like to get is, for example, a dataset for one of the top level rows and its children. <BR>3<BR> 31<BR> 33 <BR> 32<BR> 25<BR> 12<BR> 28<BR>I am assuming that I can pull all the rows and then somehow filter or select from this dataset using recursion, to get subset. Anyone have any idea how to do this?<BR><BR>Thanks in advance, Dave <BR><BR>

  2. #2

    Default RE: dataset recursion

    If you are using VS.Net, you can create a custom dataset (new project items).<BR><BR>In the xsd designer, create your two tables. <BR>If you have a Data Connection defined in the Server Explorer, you can drag the tables directly onto the designer.<BR><BR>Define the relationships between the tables.<BR><BR>Instead of Fill-ing a normal dataset, fill the two tables by specifying the name. The FK relationships will be handled.<BR><BR>You can do the same thing in code...<BR><BR>Have a look around for articles by Dino Esposito, he has several realted to heirarchal data.<BR><BR>

Posting Permissions

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