Issue Updating Database

digitaldrew

Well-known member
Joined
Nov 10, 2012
Messages
167
Programming Experience
Beginner
Could really use some help on this one..For some reason I cannot seam to update a database. I have an update query built in the tableadapter but the database never gets updated and no exceptions are ever thrown..

Using VB.NET 2010 Express Edition..

VB.NET:
  Me.TestDataSet.Clear()
  Try
       Me.Validate()
       Me.DomainNamesBindingSource.EndEdit()
       Me.DomainNamesTableAdapter.Update(Me.TestDataSet.DomainNames)
       MsgBox("Update Successful")
 Catch ex As Exception
      MsgBox("DataBase Update Error")
 End Try
 
If no exception is thrown then almost certainly the data is being saved and you're just looking for it in the wrong place or at the wrong time. The first thing to do is to test the value returned by your Update call. If it's zero then the call succeeded but there were no changes to save. If it's not zero then it will tell you how many records were affected.

Assuming that the value is greater than zero, follow the first link in my signature to learn how to manage local data files. That knowledge will allow you to find and keep your data.
 
Back
Top