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. C#
  4. Adding the result of two Anonymous Type LINQ queries

Adding the result of two Anonymous Type LINQ queries

Scheduled Pinned Locked Moved C#
csharpjavalinqcomtools
3 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.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    Hi all, Is is possible to add the result of two anonymous LINQ queries together (when the data is gathered from two different data sources), to form a variable that one foreach loop can iterate on. For example:var query1 = from x in dataCollection select new { name = x.Name, surname = x.Surname }; var query2 = from x in xmlCollection select new { name = x.Name, surname = x.Surname }; // ADD query1 and query2 ?? foreach (var result in .....
    Many thanks in advance, Kind regards,

    The only programmers that are better C# programmers, are those who look like this -> :bob:

    :java: Programm3r My Blog: ^_^

    R 1 Reply Last reply
    0
    • P Programm3r

      Hi all, Is is possible to add the result of two anonymous LINQ queries together (when the data is gathered from two different data sources), to form a variable that one foreach loop can iterate on. For example:var query1 = from x in dataCollection select new { name = x.Name, surname = x.Surname }; var query2 = from x in xmlCollection select new { name = x.Name, surname = x.Surname }; // ADD query1 and query2 ?? foreach (var result in .....
      Many thanks in advance, Kind regards,

      The only programmers that are better C# programmers, are those who look like this -> :bob:

      :java: Programm3r My Blog: ^_^

      R Offline
      R Offline
      Ravi Mori
      wrote on last edited by
      #2

      Hi..You have to post this question in Linq Forum.. Anyway checkout this link : http://blog.benhall.me.uk/2007/08/linq-to-sql-difference-between-concat.html[^]

      P 1 Reply Last reply
      0
      • R Ravi Mori

        Hi..You have to post this question in Linq Forum.. Anyway checkout this link : http://blog.benhall.me.uk/2007/08/linq-to-sql-difference-between-concat.html[^]

        P Offline
        P Offline
        Programm3r
        wrote on last edited by
        #3

        Ravi Mori wrote:

        You have to post this question in Linq Forum..

        Your right ... sorry about that :sigh:

        The only programmers that are better C# programmers, are those who look like this -> :bob:

        :java: Programm3r My Blog: ^_^

        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