join in LinqToCRM not working

Oct 5, 2011 at 8:45 PM

I get the error :


Error 1 The type of one of the expressions in the join clause is incorrect.  Type inference failed in the call to 'Join'. C:\Users\Administrator\Desktop\DEV_VM\TestChap2\ConsoleApplication1\Program.cs 127 26 ConsoleApplication1

But my code is this one:


var queryx = from c in orgContext.ContactSet
                         join a in orgContext.AccountSet
                         on c.ContactId equals a.PrimaryContactId
                         select new { contact_name = c.FullName, account_name = a.Name };
            foreach (var c in queryx)
                Console.WriteLine(c.account_name + c.contact_name);


Anyone would have an idea ?