public IEnumerable<tblCompetitionEntry> GetTempCompetitionEntries()
{
IEnumerable<tblCompetitionEntry> tempDS = from compEntries in db.tblCompetitionEntries
join comp in db.tblCompetitions on compEntries.CompetitionId equals comp.CompetitionId
join title in db.tblTitles on compEntries.TitleId equals title.TitleId
join province in db.tblProvinces on compEntries.ProvinceId equals province.ProvinceId
orderby compEntries.FirstName descending
select new tblCompetitionEntry
{
CompetitionEntryId = compEntries.CompetitionEntryId,
Competition = comp.CompetitionName,
Title = title.Title,
FirstName = compEntries.FirstName,
Surname = compEntries.SurName,
Email = compEntries.EmailAddress,
MemberNo = compEntries.MemberNumber,
Mobile = compEntries.CellNumber,
Province = province.Province
};
return tempDS;
}
"Error 1 'tblCompetitionEntry' does not contain a definition for 'Competition'"
If I change Competition to CompetitionId like it is in the tblCompetitionEntry class then I get a type error. Cannot convert int to string. Obviously because the CompetitionId is int and the name is string. It must be the joins...
Well thats basically the same problem I've had since the beginning. Not knowing how to shape a LINQ query and return it from a class file rather than the code behind file. :-(