Database doesnt update?

I have the following code in my program to update my Excel database... It appears to work in that the message box funtions as it should and the record appears to be added as i can navigate back and forth with the new data visable, however when i exit the application and check the database the new data is not there

Try

Me.Validate()

Me.ContractsBindingSource.EndEdit()

Me.ContractsTableAdapter.Update(Me.db1DataSet.Contracts)

MsgBox("update successful!")

Catch ex As Exception

MsgBox("update failed, the data may already exist please check and try again.")

End Try

 



Answer this question

Database doesnt update?

  • tirengarfio

    Yes. I believe the copy is only made when your program is built. Not sure, I always said No.


  • Linda Cornerstone

    When you created the data connection to the database, you got prompted whether you wanted to make a local copy of the Access database. You probably answered 'Yes' and are now working with the copy of the database, stored in your project's folder. This copy is made each time you run your program in the debugger. To reset back to the original database, try selecting the database in the Solution Explorer and set the 'Copy to Output Directory' property to 'Do not copy'.


  • Deco

    Right I see, I just checked the output directory and the database in there has had the changes made, does this mean that in the release it will be updating the live database
  • Database doesnt update?