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. Visual Basic
  4. copying the column values of a Datatable into another data table in vb.net

copying the column values of a Datatable into another data table in vb.net

Scheduled Pinned Locked Moved Visual Basic
tutorialcsharp
4 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.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    Can anybody tell me how to copy one column of a data table to another data table. Example:I have 2 data tables say dt1,dt2. Here,i wanna copy only the 1st column values of dt1 into the 1st column of dt2.

    D 1 Reply Last reply
    0
    • P Pankaj Garg

      Can anybody tell me how to copy one column of a data table to another data table. Example:I have 2 data tables say dt1,dt2. Here,i wanna copy only the 1st column values of dt1 into the 1st column of dt2.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Enumerate the DataRows in DT1, and copy the values into the appropriate field in DT2.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Enumerate the DataRows in DT1, and copy the values into the appropriate field in DT2.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

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

        Hi Dave.. How are you? Thanks for your reply. Well, Don't you think this(Iteration) can create the performance issue/Usability issues?

        D 1 Reply Last reply
        0
        • P Pankaj Garg

          Hi Dave.. How are you? Thanks for your reply. Well, Don't you think this(Iteration) can create the performance issue/Usability issues?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Well, the fastest option would be to have the database do it using SQL. But, if that's even possible lies in the lack of details you provided on the problem in your original post.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          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