I have this code for delete row in database by using LINQ to Entity in VB.net and when run i just receive a error message like that:
this object cannot be delete because it was not found in the ObjectStateManager
For Each row As DataGridViewRow In dataList
Dim staffCd As String = row.Cells(Col_fCode).Value.ToString
Dim deleteRow = From p In REMSDemoDB.W_frmMST020_A0_0 _
Where p.staffCD.Contains(staffCd) _
Select p
REMSDemoDB.DeleteObject(deleteRow)
Next
Any help would be much appreciated