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. datatable merging

datatable merging

Scheduled Pinned Locked Moved ASP.NET
tutorial
2 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.
  • S Offline
    S Offline
    sekannak
    wrote on last edited by
    #1

    Hi, I have a dataset with 4 datatable . tbl1 having 2 coloumns like Col1 & Col2 with 3 rows tbl2 having 2 coloumns like Col1 & Col2 with 2 rows tbl3 having 2 coloumns like Col1 & Col2 with 4 rows tbl1 col1 col2 12 10 15 20 17 23 tbl2 col1 col2 30 31 32 38 tbl3 col1 col2 58 69 41 21 14 45 78 98 So how to merge the 3 tables into a single table, the output like col1 col2 col1 col2 col1 col2 12 10 30 31 58 69 15 20 32 38 41 21 17 23 0 0 14 45 0 0 0 0 78 98 Can you anyone please give me the output...

    kannak

    A 1 Reply Last reply
    0
    • S sekannak

      Hi, I have a dataset with 4 datatable . tbl1 having 2 coloumns like Col1 & Col2 with 3 rows tbl2 having 2 coloumns like Col1 & Col2 with 2 rows tbl3 having 2 coloumns like Col1 & Col2 with 4 rows tbl1 col1 col2 12 10 15 20 17 23 tbl2 col1 col2 30 31 32 38 tbl3 col1 col2 58 69 41 21 14 45 78 98 So how to merge the 3 tables into a single table, the output like col1 col2 col1 col2 col1 col2 12 10 30 31 58 69 15 20 32 38 41 21 17 23 0 0 14 45 0 0 0 0 78 98 Can you anyone please give me the output...

      kannak

      A Offline
      A Offline
      Arindam Tewary
      wrote on last edited by
      #2

      There is no direct method that you can do. You need to loop through all column of source tables and need to create a new table having new column structure(have all column). Then using some for loop you need to add rows, again by calling source tables rows.

      Thanks, Arindam D Tewary

      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