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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Copying rows between two data views

Copying rows between two data views

Scheduled Pinned Locked Moved Visual Basic
question
1 Posts 1 Posters 1 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
    asifmaniar
    wrote on last edited by
    #1

    I have to copy rows from one data view to another. Fot this am using the following loop and each time creating a new row. But somehow in the final result the resultatt view only has one new row. The loop actually runs for each added row but only the last row is actually added. Any suggestions? Am copying rows from view2 to view.... For i = 0 To view2.Count - 1 view.AllowNew = True Dim dv As DataRowView 'adding the new row dv = view.AddNew() ' copying each column value For j = 0 To view.Table.Columns.Count - 1 dv(j) = view2.Item(i).Item(j) Next dv = nothing Next no matter how many times the above loops get executed only the last row is added :(

    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