Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Need Help to understand this error when I use join in LINQ

Need Help to understand this error when I use join in LINQ

Scheduled Pinned Locked Moved LINQ
helpcsharpdatabaselinq
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohamed El Gohary
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • M 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

      N Offline
      N Offline
      Niladri_Biswas
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups