Stacie
asked on
MVC - combining two field in a drop down from joint table
I have a table that has 2 foreign key. I would like to create in drop down that contain the value of these two foreign key. How
can I do that?
Here is my table definition:
Master Table
Id INT Prinary key
PhoneNumber VARCHAR(3)
IDLocation Foreign key to location table
IDDepartment Foreign Key to Department table
Master Table with data exammpe:
1|383-383-33838|1|1
Location Table
ID Primary key but this is related to the IDLocation Foreign key in Master table
Location Varchar
Location Table with example.
1|Chicago
Department Table
ID Primary key but this is relate to the ID Department foreng Key in Master table
Department varchar
1|Clothes
So in my drop down I would like something like this.
Please choose
Chicago - Clothes
or "Value" - "value"
can I do that?
Here is my table definition:
Master Table
Id INT Prinary key
PhoneNumber VARCHAR(3)
IDLocation Foreign key to location table
IDDepartment Foreign Key to Department table
Master Table with data exammpe:
1|383-383-33838|1|1
Location Table
ID Primary key but this is related to the IDLocation Foreign key in Master table
Location Varchar
Location Table with example.
1|Chicago
Department Table
ID Primary key but this is relate to the ID Department foreng Key in Master table
Department varchar
1|Clothes
So in my drop down I would like something like this.
Please choose
Chicago - Clothes
or "Value" - "value"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.