If I add an entry to something bound with linq then delete it before having committed anything I get the following error:
Code:
System.InvalidOperationException (System.Data.Linq.dll) - Additional information: Cannot remove an entity that has not been attached.
I searched on the internet and all of the stuff I found said to place an .Attach(DataObject), which made it work! .... kind of ...
Now adding and then deleting the item right away works, but now when I try to delete an existing Item I get:
Code:
System.InvalidOperationException (System.Data.Linq.dll) - Additional information: Cannot attach an entity that already exists.
Do I need to somehow see if the item was attached and if not call .Attach?
Any ideas? ...
Thanks in advance,
Kris