S
sirMilt
Guest
I am using Visual Basic 2010 with an SQL Server 2005 database. My form contains a DataGridView and a number f bound controls.
If I add a new record it saves the data to the correct table perfectly.
If, however, I want to make a change to an existing record, I change the entry in the bound control (or entries in the bound controls) and the click the "BindingNavigatorSaveItem" get get the "succeeded" text message and the DataGridView is changed but the table in the SQL Server is unchanged.
The code is below:
Private Sub TblBooksBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles TblBooksBindingNavigatorSaveItem.Click
Try
Me.Validate()
Me.TblBooksBindingSource.EndEdit()
Me.TblBooksTableAdapter.Update(Me.MyCollectionsDataSet.tblBooks)
lblResults.Text = "Changes to the database have succeeded."
Catch x As Exception
lblResults.Text = "There was an error in the update process. Please check your entries and try again."
End Tr
I have checked all of the Data Bindings properties and all appear to me to be correct, and in fact work fine for new record insertions. Im at a loss.
Milt
sirmilt
Continue reading...
If I add a new record it saves the data to the correct table perfectly.
If, however, I want to make a change to an existing record, I change the entry in the bound control (or entries in the bound controls) and the click the "BindingNavigatorSaveItem" get get the "succeeded" text message and the DataGridView is changed but the table in the SQL Server is unchanged.
The code is below:
Private Sub TblBooksBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles TblBooksBindingNavigatorSaveItem.Click
Try
Me.Validate()
Me.TblBooksBindingSource.EndEdit()
Me.TblBooksTableAdapter.Update(Me.MyCollectionsDataSet.tblBooks)
lblResults.Text = "Changes to the database have succeeded."
Catch x As Exception
lblResults.Text = "There was an error in the update process. Please check your entries and try again."
End Tr
I have checked all of the Data Bindings properties and all appear to me to be correct, and in fact work fine for new record insertions. Im at a loss.
Milt
sirmilt
Continue reading...