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. Update Data Table from Data Source

Update Data Table from Data Source

Scheduled Pinned Locked Moved C#
databasedesignannouncement
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
    polishprogrammer
    wrote on last edited by
    #1

    I need to update a datatable from a datasource silently. That is, I need to do regularly refresh data in datatable from its source database (MS Access database) without greatly interrupting the user experience. I don't want to clear the table and fill it from an OleDbDataAdapter, but use some other method. Any suggestions would be appreciated. Thanks.

    W 1 Reply Last reply
    0
    • P polishprogrammer

      I need to update a datatable from a datasource silently. That is, I need to do regularly refresh data in datatable from its source database (MS Access database) without greatly interrupting the user experience. I don't want to clear the table and fill it from an OleDbDataAdapter, but use some other method. Any suggestions would be appreciated. Thanks.

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      If you don't want that the UI goes to nonresponding state, use BackgroundWorker[^] class to fetch the data. When fetching the data n DoWork method, use OleDbDataAdapter, OleDbDataReader or what ever is suitable.

      The need to optimize rises from a bad design.My articles[^]

      P 1 Reply Last reply
      0
      • W Wendelius

        If you don't want that the UI goes to nonresponding state, use BackgroundWorker[^] class to fetch the data. When fetching the data n DoWork method, use OleDbDataAdapter, OleDbDataReader or what ever is suitable.

        The need to optimize rises from a bad design.My articles[^]

        P Offline
        P Offline
        polishprogrammer
        wrote on last edited by
        #3

        Thanks, Mika. I had thought of a BackgroundWorker, but I was also hoping to retrieve updates while preserving any changes the user was making to the current DataTable. The DataTable.Merge(DataTable) method, where the DataTable passed into the method reflects the current state of the database) seemed like a good option to me, but I have not been able to get the Merge method to work. If you have any suggestions regarding how to use the Merge method, or any relevant articles to point me to, I would appreciate it. Thanks.

        W 1 Reply Last reply
        0
        • P polishprogrammer

          Thanks, Mika. I had thought of a BackgroundWorker, but I was also hoping to retrieve updates while preserving any changes the user was making to the current DataTable. The DataTable.Merge(DataTable) method, where the DataTable passed into the method reflects the current state of the database) seemed like a good option to me, but I have not been able to get the Merge method to work. If you have any suggestions regarding how to use the Merge method, or any relevant articles to point me to, I would appreciate it. Thanks.

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          polishprogrammer wrote:

          but I have not been able to get the Merge method to work

          Could you post what you've done so far and what's the problem. Otherwise it's hard to give any hints.

          The need to optimize rises from a bad design.My articles[^]

          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