Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refreshing the datagrid after a delete operation

Status
Not open for further replies.

sand133

Programmer
Jun 26, 2004
103
GB
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
 
try giving us your complete code (yes the complete form) because you keep giving us bits and pieces and perhaps the error is somewhere completely different. And error WHAT ERROR. if the update method fails it could have many reasons.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top