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. Web Development
  3. ASP.NET
  4. How to check the same record at the array?

How to check the same record at the array?

Scheduled Pinned Locked Moved ASP.NET
questiondata-structurestutorial
5 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.
  • C Offline
    C Offline
    cheeken2u
    wrote on last edited by
    #1

    i have an array storing Employee ID like 1,2,3,4,5,6.. how do i check whether the array have same employee Id or not? i means, if the array store 4,2,4,1,5... then return false if the arrat store no repeat employee id, like 1,5,2,6,.. then return true how i check this array?

    Best regards, Chee ken

    G 1 Reply Last reply
    0
    • C cheeken2u

      i have an array storing Employee ID like 1,2,3,4,5,6.. how do i check whether the array have same employee Id or not? i means, if the array store 4,2,4,1,5... then return false if the arrat store no repeat employee id, like 1,5,2,6,.. then return true how i check this array?

      Best regards, Chee ken

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      If you first sort the array, you can easily loop through it to look for duplicates, as they are then next to each other.

      --- It's amazing to see how much work some people will go through just to avoid a little bit of work.

      C 1 Reply Last reply
      0
      • G Guffa

        If you first sort the array, you can easily loop through it to look for duplicates, as they are then next to each other.

        --- It's amazing to see how much work some people will go through just to avoid a little bit of work.

        C Offline
        C Offline
        cheeken2u
        wrote on last edited by
        #3

        how to sort the array?

        Best regards, Chee ken

        G 1 Reply Last reply
        0
        • C cheeken2u

          how to sort the array?

          Best regards, Chee ken

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Use the Array.Sort method.

          --- It's amazing to see how much work some people will go through just to avoid a little bit of work.

          C 1 Reply Last reply
          0
          • G Guffa

            Use the Array.Sort method.

            --- It's amazing to see how much work some people will go through just to avoid a little bit of work.

            C Offline
            C Offline
            cheeken2u
            wrote on last edited by
            #5

            my problem solved already ,thank you very much !

            Best regards, Chee ken

            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