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. Uniqueness

Uniqueness

Scheduled Pinned Locked Moved LINQ
questioncsharplinqcareerlearning
4 Posts 3 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.
  • S Offline
    S Offline
    Steve van Niman
    wrote on last edited by
    #1

    I've ordered my Linq book, but since it has not arrive and I'm trying to finish a project, I have a question. Is there a slick Linq command to find out if a value in a NON key field (column) is unique? The old fashion way of retrieving via a where clause will get the job done, just wondered if there is a short cut.

    A 1 Reply Last reply
    0
    • S Steve van Niman

      I've ordered my Linq book, but since it has not arrive and I'm trying to finish a project, I have a question. Is there a slick Linq command to find out if a value in a NON key field (column) is unique? The old fashion way of retrieving via a where clause will get the job done, just wondered if there is a short cut.

      A Offline
      A Offline
      Arun Jacob
      wrote on last edited by
      #2

      If you are trying to save unique data, before saving just check if that field already having that value. Where clause is enough to do that. :)

      Arun Jacob http://codepronet.blogspot.com/

      S 1 Reply Last reply
      0
      • A Arun Jacob

        If you are trying to save unique data, before saving just check if that field already having that value. Where clause is enough to do that. :)

        Arun Jacob http://codepronet.blogspot.com/

        S Offline
        S Offline
        Steve van Niman
        wrote on last edited by
        #3

        Arun, Was looking for an even faster shortcut. Already created the lookup in where clause. Thanks for the response. Steve

        T 1 Reply Last reply
        0
        • S Steve van Niman

          Arun, Was looking for an even faster shortcut. Already created the lookup in where clause. Thanks for the response. Steve

          T Offline
          T Offline
          Thanigainathan S
          wrote on last edited by
          #4

          Hi please use group by having command in LINQ to find the value is unique or not. If C# then try using Lambda expression to filter out the unwanted values. Thanks, Thani

          India is Mythical and so we are

          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