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. Left Join 2 Datatable

Left Join 2 Datatable

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-net
3 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.
  • A Offline
    A Offline
    AnhTin
    wrote on last edited by
    #1

    Hi all I have 2 Datatable the fist (dtUser): have column UserID, Name, Address (10 rows) the second(dtOrder): have column OrderID, UserID (5) And 2 datatable haven't relationship How can i "Select * from dtOrder A LEFT JOIN dtUser B ON A.UserID = B.UserID" in new datatable by Asp.net ??

    P P 2 Replies Last reply
    0
    • A AnhTin

      Hi all I have 2 Datatable the fist (dtUser): have column UserID, Name, Address (10 rows) the second(dtOrder): have column OrderID, UserID (5) And 2 datatable haven't relationship How can i "Select * from dtOrder A LEFT JOIN dtUser B ON A.UserID = B.UserID" in new datatable by Asp.net ??

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Your question has nothing to do with ASP.NET. However, you can define parent/child relationships between DataTables by using the DataRelation[^] class.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      1 Reply Last reply
      0
      • A AnhTin

        Hi all I have 2 Datatable the fist (dtUser): have column UserID, Name, Address (10 rows) the second(dtOrder): have column OrderID, UserID (5) And 2 datatable haven't relationship How can i "Select * from dtOrder A LEFT JOIN dtUser B ON A.UserID = B.UserID" in new datatable by Asp.net ??

        P Offline
        P Offline
        Pankaj Garg
        wrote on last edited by
        #3

        SELECT * FROM dbo.dtOrder INNER JOIN dbo.dtuser ON dbo.dtOrder.UserID = dbo.dtuser.UserID

        If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

        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