Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a DataAdapter/DataSet/DataGrid application I created using the database wizard. The problem is that if I make a change to a cell in the datagrid and then close the application without moving the focus to another record, the database doesn't get changed. If I move the focus to another record first, everything is OK. How do I force it to update? I am currently doing this when the application is closed:

 

   Private Sub UpdateDB()
       daWheelLog.Update(dsWheelLog)
   End Sub

 

The DataGrid is called dgrWheelLog. I tried this:

 

  dsWheelLog.AcceptChanges()

 

I put that before the daWheelLog.Update line, but that didn't work. What do I need to do?

Posted
I found a workaround for this problem. In my form_close event, I set the DataSource property of my datagrid to nothing. That forces the changes into the dataset.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...