FormView and foreign keys

J

Jessica

I'm thinking this should be a simple problem, but I cannot figure it out
nor can I find the answer anywhere.

I have a FormView displaying a record (Customer). In this record are some
foreign keys, AddressA_ID, AddressB_ID, and Orders_ID. I have another
FormView to display the AddressA record, and another one to display the
AddressB record, but how do I link these back to the foreign keys in the
main FormView? I've tried a bunch of things, including creating two Labels
(outside all FormViews), LabelA and LabelB, and using their values in the
WHERE clauses for those two FormViews. Then I have the
FormViewMain_PageIndexChanged() use FindControl to get AddressA_ID and put
it in LabelA, (and the same for AddressB_ID), which causes those two
FormViews to show the correct record, (this doesn't work very well,
though).

Similarly, I want a to populate a listbox with items matching Orders_ID.

These seem like very common situations - is there a trick or am I missing
something totally obvious here?

Thanks,
Jessica
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top