self referencing table + typedList

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 25-Sep-2007 15:59:20   

version 1.0.2005.1 final (self-servicing) VS2005 asp.net 2.0


hiya, I have a situation where I need to grab values from a self-referencing table. I previously posted to this thread, but didn't quite manage to get it working 100%, so I thought I'd try again:

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=11057

I'm using the following schema

tblPerson personId PK motherId FK tblPerson.personId fatherId FK tblPerson.personId

I have been able to use a typedList to create the "mother" of the person in question.

The relation is as follows:

tblPerson.motherId - mother.personId(m:1) (left join)

selected used relation:

tblPerson -mother(m:1) tblPerson.motherId -mother.personId(m:1)

I want to do EXACTLY the same with father.

However, when I follow the same steps that I used with "mother" in the designer, the relationship is added, but it seems to be reversed:

it SHOULD be the following:

tblPerson.FATHERID -father.personId(m:1) (left join)

instead it's

tblPerson.MOTHERID -father.personId(m:1) (left join)

I know that the schema etc is correct.

My only guess is that the designer is grabbing the 1st foreignKey relation that it sees in tblPerson (that of MOTHERID)

Can anyone help?

Please let me know if I should clarify anything.

many thanks,

yogistuck_out_tongue_winking_eye

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 25-Sep-2007 18:14:43   

Hello yogiberr, in the edit/properties window of the typed list you've created (designer), click the father relation (in the relation used grid) and then use the Select Alternative drop down list below to swap to the relation alternative you like.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 27-Sep-2007 13:32:25   

hiya Goose,

That worked, Thanks.

I'm going to try a recursive function to get the rest of it working.If I have any hassles I'll post back on a separate thread.

ta,

yogi