I have been struggling with question for some time now and I have tried Everything. there are similar questions on stack overflow but I have tired all solutions none of them worked for me. The problem is changes are not stored on the data base file after I call the data source binding. below is the code snippet for save button
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
If isValidData() = True Then ' sub routine that checks data inputted into textboxes is valid.
Try
' i get data from the textboxes on form which are binded to the bindingsource viewplanet...
Me.ViewPlanetAlliancesBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsLab4)
MessageBox.Show("Successfully Saved Data Row")
Call updateViewPlanetAlliance()
Catch ex As DBConcurrencyException
MessageBox.Show("A concurrency erro occured. " & "the row was not deleted.", "Concurrency Exception")
Me.ViewPlanetAlliancesTableAdapter.FillByRegionID(DsLab4.viewPlanetAlliances, CInt(Me.lstRegion.SelectedValue))
Catch ex As ArgumentException
MessageBox.Show(ex.Message, "Argument exception")
Me.ViewPlanetAlliancesBindingSource.CancelEdit()
Catch ex As DataException
MessageBox.Show(ex.Message, ex.GetType.ToString)
Me.ViewPlanetAlliancesBindingSource.CancelEdit()
End Try
Else
Try
Me.TableAdapterManager.UpdateAll(Me.DsLab4)
Catch ex As DBConcurrencyException
MessageBox.Show("A concurrency erro occured. " & "the row was not deleted.", "Concurrency Exception")
Me.ViewPlanetAlliancesTableAdapter.FillByRegionID(DsLab4.viewPlanetAlliances, CInt(Me.lstRegion.SelectedValue))
End Try
End If
End Sub
This is what my form looks like and how my data is displayed