I didn't know exactly how to phrase this question, so sorry if it sounded a little weird to you guys. It is a follow up to my question about joined tables and table aliases, only this time my issue is with the ASP.NET markup.
As I said in my previous question, I am making a cheat page for the game Doodle Creatures. I have a Select statement that joins two image directories - Animals and Genes - in order to display the images as shown below. The script now works, but one of my image bindings is wrong.
Here are the first five combinations as they should be:
Here are the combos as they are now:
Aphid + Small = Aphid.
' SelectCommand="SELECT * FROM [CreatureCombos] INNER JOIN [Animals] AS Animal1 ON [CreatureCombos].[NewCreatureID] = Animal1.[AnimalId] INNER JOIN [Animals] AS Animal2 ON [CreatureCombos].[ComboAnimalID] = Animal2 .[AnimalId] INNER JOIN [Genes] ON [CreatureCombos].[ComboGeneID] = [Genes].[GeneId];">
' Width="25%" />+' Width="25%" />=' Width="25%" />
Any suggestions?
I think your issue has everything to do with SELECT *
- your query has the Animals
table specified twice, and the select is returning every field of every table, so you might be getting something like...
I'm not sure how Bind("AnimalImage")
ends up selecting which instance of the AnimalImage
field, but my bet is on the SELECT *
being the culprit.
Instead of SELECT *
, specify exactly which fields you need to fetch, and make sure each field name only appears once in your result set:
SELECT
Animal1.AnimalImage AS AnimalImage1
,Animal2.AnimalImage AS AnimalImage2
...
Then you can Bind("AnimalImage1")
when you want the image from the Animal1
table, and to AnimalImage2
when you want the image from the Animal2
table.