I am trying to delete a selected gridview row using LINQ (No LINQDataSource).
When the selection is changed, the detailsview binding is changed also. I can add a new
I had a similar problem and although deleting and re-adding the DBML table/class helped some users, for me it was a bit different since I'm using WCF with detached entity and a ListView on the client.
If I used the .Attach(entity) it failed - "Row not found or changed" But when using .Attach(entity, original) it works every time
public void DeleteTask(Task task)
{
TwoDooDataContext db = new TwoDooDataContext();
db.Tasks.Attach(task,GetTaskByID(task.ID));
db.Tasks.DeleteOnSubmit(task);
db.SubmitChanges();
}