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. Merge DataTable

Merge DataTable

Scheduled Pinned Locked Moved C#
questiondatabasehelpannouncement
3 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.
  • K Offline
    K Offline
    Kit Fisto
    wrote on last edited by
    #1

    Hi all. I have a problem and i can't seem to solve it. I have a DataTable with all the Data a need. From time to time i need to make a call to the DataBase to refresh the DataTable. I need to add/update/remove the rows from the DataTable comparing them to the rows that came from the DataBase. How can i do that? I can add the new rows, but if some rows where deleted/updated in the DataBase how can i delete/update them from my DataTable?

    S 1 Reply Last reply
    0
    • K Kit Fisto

      Hi all. I have a problem and i can't seem to solve it. I have a DataTable with all the Data a need. From time to time i need to make a call to the DataBase to refresh the DataTable. I need to add/update/remove the rows from the DataTable comparing them to the rows that came from the DataBase. How can i do that? I can add the new rows, but if some rows where deleted/updated in the DataBase how can i delete/update them from my DataTable?

      S Offline
      S Offline
      snorkie
      wrote on last edited by
      #2

      How about just clearing the DataTable and re-grabbing the data from the database. since you're bring all the data down anyway, it would probably save some CPU time as well. Hogan

      K 1 Reply Last reply
      0
      • S snorkie

        How about just clearing the DataTable and re-grabbing the data from the database. since you're bring all the data down anyway, it would probably save some CPU time as well. Hogan

        K Offline
        K Offline
        Kit Fisto
        wrote on last edited by
        #3

        Thats right. But theres only one problem. If the user has scroll down the Grid and i clear the DataTable and refill-it then scroll will go to the first item in the list. Is there a way of avoinding that? Thanks for your reply.

        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