I have created a form called new users, I have added my data source, draged over the objects I want from the dataset onto the form and all is well appart from the fact that I cant delete records.
To add them I simply click the add button, put in my info and then click the little disk button to update the dataset.
This does not work for the delete button though, instead I get the following error
UPDATE REQUIRES A VALID DELETE COMMAND WHEN PASSED DATA ROW COLLECTION WITH DELETED ROWS.
This is the code for my form.
Public Class NewUsers Private Sub UsersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UsersBindingNavigatorSaveItem.Click Me.Validate() Me.UsersBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.MtrmanagerDataSet) End Sub Private Sub NewUsers_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'MtrmanagerDataSet.Users' table. You can move, or remove it, as needed. Me.UsersTableAdapter.Fill(Me.MtrmanagerDataSet.Users) End Sub End Class
Can anyone give me a guide as to what code I need to use so I can delete recods and then update or save the current data.
Thanks very much.