c# - System.Data.Linq.ChangeConflictException: Row not found or changed -


I wasted a better part of the day and I am not close to understanding this issue, what was I in the morning?

I am looping through a set of objects and marking them to delete. The second one always causes the exception to the above. Tb_invoice is an FK in tb_shipment.

As always, I'm probably missing something very obvious, but I've already stripped a lot from this code that nothing is left, and I'm still getting this exception, it's a The local SQL 2008 example is definitely nothing and no one changes between invoicing and reading of the invoices. help!

  myDataContext db = new myDataContext (); IQueryable & LT; InvoiceDetail & gt; Pending Challan = db.GetInvoiceDetailPending (); Forex Currency (Invoice Discrete ID in Pending Invoice) {tb_shipment s = db.GetShipmentById ((Guid) id.shipment_id); Db.tb_invoices.DeleteOnSubmit (db.GetInvoiceById (s.tb_invoices.FirstOrDefault (.ID));} Variable fails (); // Other invoice fails  

Setting the "Cascade" in SQL Server to remove the action for the foreign key I wish I had remembered earlier That I had already gone to it.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -