SELECT i.answerc, d.answera, d.answerb
FROM tableone AS u
INNER JOIN tabletwo AS i ON u.OneId = i.OneId
INNER JOIN tablethree AS l ON u.TwoId = l.TwoId
INNER JOIN tablefour AS k ON u.ThreeId = k.ThreeId
INNER JOIN tablefive AS p ON u.fourId = p.fourId
INNER JOIN tablesix AS d ON u.fiveId = d.fiveId
WHERE u.columnone = @parameter_one
AND l.columnone = @parameter_two
AND k.columnone = @parameter_three
AND p.columnone = @Parameter_four
I have the Model created, but how I would write this query is confusing me right now? Can anybody help me out here? I had this working using old school SqlConnection but I’ve been told to port it to the Entity Framework 4.
If your tables are not in relations than there is no navigation properties in .edmx file. So your LINQ should be something like this :
Where parameterXXX are variables.
But if you have navigation properties, you should use them!