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. Select Distinct in LINQ

Select Distinct in LINQ

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinqhelp
2 Posts 2 Posters 2 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
    minnie mouse
    wrote on last edited by
    #1

    In SQL its fairly easy to get a set of rows from several Tables which are unique based on the value of one column. I am wanting to do this on a DataSet using LINQ eg: Select from a Imported Datatable all the rows, which have a "Name" in the Name column, which are not currently in the Name column of the existing Persons DataTable. i have had a look at a few things and the select distinct is no problem, its the LINQ equivalent of the SQL " WHERE NOT IN" that i am having difficulty understanding. Any guidance would be greatly appreciated:confused: Thanks Folks in advance

    P 1 Reply Last reply
    0
    • M minnie mouse

      In SQL its fairly easy to get a set of rows from several Tables which are unique based on the value of one column. I am wanting to do this on a DataSet using LINQ eg: Select from a Imported Datatable all the rows, which have a "Name" in the Name column, which are not currently in the Name column of the existing Persons DataTable. i have had a look at a few things and the select distinct is no problem, its the LINQ equivalent of the SQL " WHERE NOT IN" that i am having difficulty understanding. Any guidance would be greatly appreciated:confused: Thanks Folks in advance

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Take a look at the Except operator.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      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