Parameters
- entity
- The entity to be deleted.
// Query the database for the rows to be deleted. var deleteOrderDetails = from details in db.OrderDetails where details.OrderID == 11000 select details; foreach (var detail in deleteOrderDetails) { db.OrderDetails.DeleteOnSubmit(detail); } try { db.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e); // Provide for exceptions. }
' Query the database for the rows to be deleted. Dim deleteOrderDetails = _ From details In db.OrderDetails() _ Where details.OrderID = 11000 _ Select details For Each detail As OrderDetail In deleteOrderDetails db.OrderDetails.DeleteOnSubmit(detail) Next Try db.SubmitChanges() Catch ex As Exception Console.WriteLine(ex) ' Provide for exceptions End Try
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2