Need Help to understand this error when I use join in LINQ
-
I am trying to join between 2 queries using LINQ, I am using the following code:
accounts = from a in accounts
join ab in accountBalance
on a.ACCOUNT_ID equals ab.ACCOUNT_ID
where ab.CURRENCY_ID == currencyID
select a;given that accounts and accountBalance are both output of LINQ queries. When compiling this piece of code I get the following error: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<AnonymousType#1>' to 'System.Data.EnumerableRowCollection<AnonymousType#1> I don't understand the reason behind this error since the query seems right.
Mohamed El Gohary
-
I am trying to join between 2 queries using LINQ, I am using the following code:
accounts = from a in accounts
join ab in accountBalance
on a.ACCOUNT_ID equals ab.ACCOUNT_ID
where ab.CURRENCY_ID == currencyID
select a;given that accounts and accountBalance are both output of LINQ queries. When compiling this piece of code I get the following error: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<AnonymousType#1>' to 'System.Data.EnumerableRowCollection<AnonymousType#1> I don't understand the reason behind this error since the query seems right.
Mohamed El Gohary
Check this site. A person with very similar kind of problem of yours found this solution. http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/bce2aced-2284-498a-b206-a9203cd19937[^] Hope this helps :)
Niladri Biswas