Last post Dec 16, 2010 04:04 PM by jjfrick
Dec 16, 2010 09:22 AM|jjfrick|LINK
I'm using EF/VS2010. I have three tables: Guest < 1-to-1 >Residence< many-to-1 >
To get a list of all Guest staying in the same Building with
GuestID:1001, I must do the following...
So I want to use the GuestID to get the ResidenceID to get the BuildingID (skipping step 2).
My url would look like this: .../Residences/BuildingList.aspx?GuestID=1001
But it would jump to something like this: .../Residences/BuildingList.aspx?BuildingID=874
So I'm guessing I need to do a query in the page load to retrieve the ResidenceID of the guest, followed by another query to get the BuidingID of the Residence. If anyone has tried something like this please share how you did it.
FK Links Custom Page
Dec 16, 2010 04:02 PM|AZMatt|LINK
First, the links you posted are pointing to your local machine, so we can't see them.
As for your question, I would recommend you create a view that joins the three tables and then you could retreive what you need from one query.
Dec 16, 2010 04:04 PM|jjfrick|LINK
Sorry, It's not posted. It's just to show the parameters - I'll change the links.