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. C# DataTable

C# DataTable

Scheduled Pinned Locked Moved C#
questioncsharp
5 Posts 4 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.
  • J Offline
    J Offline
    jojoba2010
    wrote on last edited by
    #1

    How do I select distinct rows from a DataTable?

    M L OriginalGriffO 3 Replies Last reply
    0
    • J jojoba2010

      How do I select distinct rows from a DataTable?

      M Offline
      M Offline
      mrcooll
      wrote on last edited by
      #2

      fill it distinct !!!!:cool:

      1 Reply Last reply
      0
      • J jojoba2010

        How do I select distinct rows from a DataTable?

        L Offline
        L Offline
        loyal ginger
        wrote on last edited by
        #3

        By "DataTable", do you mean a table in a database? In my opinion, there should be no identical rows (rows with identical values for ALL fields) in a database table. So please clarify your question a bit. Thanks!

        OriginalGriffO 1 Reply Last reply
        0
        • J jojoba2010

          How do I select distinct rows from a DataTable?

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Assuming that you want to select specific rows from a DataTable object rather than a database table, you can use the DataTable.Select method[^]

          All those who believe in psycho kinesis, raise my hand.

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • L loyal ginger

            By "DataTable", do you mean a table in a database? In my opinion, there should be no identical rows (rows with identical values for ALL fields) in a database table. So please clarify your question a bit. Thanks!

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #5

            By definition no real database (as opposed to using excel or similar as a datasource) will allow two identical records in all fields: The primary key must be unique. It is perfectly possible (but very annoying) to have all other fields identical between two or more records, though. Software should cope with it (as well as try to prevent it), because people will make mistakes... I think the OP is talking about using a DataTable object, though.

            All those who believe in psycho kinesis, raise my hand.

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            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