I'm currently trying to join a column from another table to an existing table and return it to the view in MVC 4
var q = from accCo in db.AccControls
join accCom in db.AccCompanies
on new { accCo.ControlCode } equals
new { ControlCode = accCom.Code }
where accCo.ControlCode == Request.QueryString["ControlCode"]
orderby accCom.Code
select new Combined{ AccControls = accCo, AccCompoanies = accCom };
return View(q);
But I'm getting the above error
Best Answer
If any of the columns you join on is nullable, you will need to change it to .Value
or you can use this