assuming that u ( thread initiator ) have populated using database. Then u have to run and delete against database and reload the grid to reflect the database changes.
'Initialize the OleDbDataAdapter object and fill DataSet.
objDA = New OleDbDataAdapter(selectString, MyConnection)
objDA.Fill(objDS, "yourTableName"
'Set the DataView object to the DataSet object.
myDV = New DataView(objDS.Tables("yourTableName")
'Set our CurrencyManager object to the DataView object.
objCM = CType(Me.BindingContext(myDV), CurrencyManager)
myDataGrid.DataSource = myDV
Catch Excep As System.Exception
MessageBox.Show(Excep.Message, "Prospect Management System (srcPros)", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub onDeleteClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
If MessageBox.Show("Are you sure to delete this record?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = DialogResult.Yes Then
'Call your delete procedure
DeleteProspect()
'Remove deleted row from the DataGrid.
myDV.Delete(myCurrencyManager.Position)
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.