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. Updating DataSet

Updating DataSet

Scheduled Pinned Locked Moved C#
databasequestionannouncement
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.
  • B Offline
    B Offline
    BoBo
    wrote on last edited by
    #1

    I want to bind a table in my access database to a datagridview control in my application. I have created a dataset, and bind the table successfully to my datagridview. Now I want to add two new columns to the table in database. I have updated the data table of both dataset and access database, however, the changes are not reflected in the datagridview, as I added two new columns into datagridview, I can not see the two fields I just added to the dataset when I try to set DataPropertyName field. Datagridview control still binds to the old dataset even though the dataset has been changed. The only way Ive found to update the datagridview is to delete the dataset and create a new one base on the updated database. Is there a way to update the dataset automatically without deleting the old dataset? Thanks in advance:)

    H 1 Reply Last reply
    0
    • B BoBo

      I want to bind a table in my access database to a datagridview control in my application. I have created a dataset, and bind the table successfully to my datagridview. Now I want to add two new columns to the table in database. I have updated the data table of both dataset and access database, however, the changes are not reflected in the datagridview, as I added two new columns into datagridview, I can not see the two fields I just added to the dataset when I try to set DataPropertyName field. Datagridview control still binds to the old dataset even though the dataset has been changed. The only way Ive found to update the datagridview is to delete the dataset and create a new one base on the updated database. Is there a way to update the dataset automatically without deleting the old dataset? Thanks in advance:)

      H Offline
      H Offline
      hamid_m
      wrote on last edited by
      #2

      in many times after change fileds in dataset, you need to configure all its dataadapter querys (Fill is first) again. in other word you just open each query and then closed it.

      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