I am trying to use the following LINQ to SQL code in my code:
(from s in dc.Accounts join purchases in dc.Transactions on s.AccID equals purchases.Account into pu join pop in dc.POPTransactions on new { s.ID, syncNo } equals new {AccId = pop.AccountID, SyncNo = pop.SyncNo } into po where s.AccID == ID && s.Customer == false select new AccsandPurchase { acc = s, purchases = pu.ToList(), pop = po.ToList() } ));
The error is in the second line of the connection (the 3rd line in the entire request above) - I used it to just join s.ID and pop.AccountID, and it worked fine, but now I presented one more criterion for joining (syncno) I I get the following error:
"The type of one of the expressions in the join clause is incorrect. The type could not complete the output in 'GroupJoin'"
Any ideas? Some notes:
1: the "syncNo" variable is long, like the value in the DB (bigint). The value in db is zero, so I also tried "long?" As the type of the variable
2: AccsandPurchase is a custom class that I made as you can probably guess
thanks
c # linq linq-to-sql
Chris
source share