Hi all,
I have created a simple SQL Server database by Visual Studio 2005, with one table 'Friends' that has just ID, Name, Phone, Email.
Then created a datagrid to this table (just by dragging the table name from the 'Data Sources' explorer to the form.
When I run the application, the form reads the data correctly in the data grid, but when I update, add new, or delete a record, then click save, it accepts the action but no modification is done the table! I only can change the data by accessing the table from the 'Database Explorer'.
Any Idea how to solve this problem plz.
Here's the code of the data adapter of the datagrid:
Form Load:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FriendsTableAdapter.Fill(Me.TestDB2DataSet.Friends)
End Sub
The Save Button code:
Private Sub FriendsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FriendsBindingNavigatorSaveItem.Click
Me.Validate()
Me.FriendsBindingSource.EndEdit()
Me.FriendsTableAdapter.Update(Me.TestDB2DataSet.Friends)
End Sub
Thanks for help