Ok so I am writing code to a contacts database and as i add new info to the table it is not committing to the table.
I have attached my program... idk if you will be able to open it.
But I have 2 buttons one adds a new row to a datagrid and the save is suppose to save the data in the grid to the table called contacts.mdf
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click Try If newDataAdded Then Me.Validate() Me.ContactsBindingSource.EndEdit() Me.ContactsTableAdapter.Fill(Me.ContactsDataSet.Contacts) newDataAdded = False Else Me.Validate() Me.ContactsBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.ContactsDataSet) End If Catch ex As Exception MessageBox.Show(ex.Message, "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub
this is what i have amounted to to try... but yet no success.
If you could help me to understand how to commit data in vb.net would be much appreciated