Borrar registros con LINQ
0 Comments
' 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
Más información en http://msdn.microsoft.com/en-us/library/bb386925.aspx