i have a datagrid when the user selects what row to delete, he or she then has to press the 'delete button' to perform the operation of deletion. This bit works fine, the row gets delted and the table in my database also gets updated. Now my problem is after a successfull deletion if i try another i get an error saying: system error, i think i may need to refresh the datagrid im not sure but when i debug it, an error shows up where i have placed ********
(see below)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If (grdFind.CurrentCell.RowNumber > -1) Then
dv.Delete(grdFind.CurrentCell.RowNumber)
Dim mydatasetchanges As New DataSet()
mydatasetchanges = Dataset21.GetChanges()
mydatasetchanges = Dataset21.GetChanges(DataRowState.Deleted)
SqlDataAdapter1.Update(Dataset21) *********
End If
End Sub
(see below)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If (grdFind.CurrentCell.RowNumber > -1) Then
dv.Delete(grdFind.CurrentCell.RowNumber)
Dim mydatasetchanges As New DataSet()
mydatasetchanges = Dataset21.GetChanges()
mydatasetchanges = Dataset21.GetChanges(DataRowState.Deleted)
SqlDataAdapter1.Update(Dataset21) *********
End If
End Sub