Update requires a valid UpdateCommand

lorena

Well-known member
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
when passed DataRow collection with modified row - this is the error message I am getting when I try to update my datagridview.
The form is simple (or so I thought) - I just did the drag and drop and let VS2005 do all the code but when I try to update the datagridview, it deletes the information in the cell and I get the error message.
Here is my code:
Code:
Public Class RiskReleaseUsersForm

  Private Sub TDS_RR_EMPLOYEEBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TDS_RR_EMPLOYEEBindingNavigatorSaveItem.Click
    Me.Validate()
    Me.TDS_RR_EMPLOYEEBindingSource.EndEdit()
    Me.TDS_RR_EMPLOYEETableAdapter.Update(Me.RiskReleaseEmployeesDataSet.TDS_RR_EMPLOYEE)

  End Sub

  Private Sub RiskReleaseUsersForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) _
    Handles Me.FormClosing
    Make sure validation events dont keep the form from closing
    e.Cancel = False
    Show the main menu
    menuForm.Show()
  End Sub

  Private Sub RiskReleaseUsersForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    TODO: This line of code loads data into the RiskReleaseEmployeesDataSet.TDS_RR_EMPLOYEE table. You can move, or remove it, as needed.
    Me.TDS_RR_EMPLOYEETableAdapter.Fill(Me.RiskReleaseEmployeesDataSet.TDS_RR_EMPLOYEE)

  End Sub

  Private Sub ExitToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
    Me.Close()
    Show the main menu
    menuForm.Show()
  End Sub

End Class
What am I missing?
 
Back
Top