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. Database & SysAdmin
  3. Database
  4. DataAdapter.Update not working

DataAdapter.Update not working

Scheduled Pinned Locked Moved Database
databasehelpannouncementworkspace
2 Posts 2 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.
  • L Offline
    L Offline
    luckyeagle
    wrote on last edited by
    #1

    I want to create a windows application which contains a datagridview control, and a ‘save’ button. Once the form is loaded a table (Table1) will be populated into the datagridview automatically. Users can modify the data cell contents and then click the save button to update the MS access database file. I setup the datasource and datamember of the datagridview porperty to be a simple MS Access datatable file db.mdb which only contains a table “Table1” with 2 fields, ‘ID’ (Text) and ‘value’(Number), 2 columns are displayed in the datagridview automatically. Then I added a button_click event of the save button, and coding as below: this.testTableTableAdapter.Connection.Open(); this.testTableTableAdapter.Update(this.dataSet.Table1); this.testTableTableAdapter.Connection.Close(); Once the application is running, the values in Table1 are populated successfully into the datagridview, however after the user modified some of the values in the cells and then click ‘Save’, the MS Access database file is not updated. I have checked that the dataset is updated as the user modifies the values, so the parameter of the Update method of the data adapter has no problem. Could anyone give me a help, thanks.

    M 1 Reply Last reply
    0
    • L luckyeagle

      I want to create a windows application which contains a datagridview control, and a ‘save’ button. Once the form is loaded a table (Table1) will be populated into the datagridview automatically. Users can modify the data cell contents and then click the save button to update the MS access database file. I setup the datasource and datamember of the datagridview porperty to be a simple MS Access datatable file db.mdb which only contains a table “Table1” with 2 fields, ‘ID’ (Text) and ‘value’(Number), 2 columns are displayed in the datagridview automatically. Then I added a button_click event of the save button, and coding as below: this.testTableTableAdapter.Connection.Open(); this.testTableTableAdapter.Update(this.dataSet.Table1); this.testTableTableAdapter.Connection.Close(); Once the application is running, the values in Table1 are populated successfully into the datagridview, however after the user modified some of the values in the cells and then click ‘Save’, the MS Access database file is not updated. I have checked that the dataset is updated as the user modifies the values, so the parameter of the Update method of the data adapter has no problem. Could anyone give me a help, thanks.

      M Offline
      M Offline
      mcljava
      wrote on last edited by
      #2

      Make sure your DataAdapter logic, including TableMappings, Fill, etc are all within a Try/Catch block, the you can print out the Exception.Message to see what is causing the I/O failure. Good Luck Mike Luster CTI/IVR/Telephony SME

      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