I have a database with three tables as below
Tbl 1
Product - ID, Name, Description, MediaType
Tbl 2
Media - ID, MediaName, MediaDescription
Tbl3
ProductAndMedia - ID, MediaID, ProductID
In tbl3 MediaID and ProductID are Foreign Keys.
I then have a Linq query
Dim query = From MyDataContext.ProductAndMedia.Where(Function(i) i.ProductID = PiD).ToList()
It is then made as a DataSource for a radioButton
rbt.DataSource = query
rbt.DataTextField = ????
rbt.DataValueField = "ID"
rbt.DataBind()
What i am trying to achieve is to have the MediaName to be the TextField for the radionButton list. If i use MediaID, ProductID as the textfield then it shows the ID for that particular product/media but i am after the Name in this instance.
Is there anyway to get the name in this way or would i need to make another call to the database to get the name by ID?