Table<TEntity>.ITable.DeleteOnSubmit Method (Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Puts an entity from this table into a pending delete state.

Namespace:   System.Data.Linq
Assembly:  System.Data.Linq (in System.Data.Linq.dll)

void ITable.DeleteOnSubmit(
	object entity


Type: System.Object

The entity to be removed.

This member is an explicit interface member implementation. It can be used only when the Table<TEntity> instance is cast to an ITable interface.


   LINQ to SQL does not support or recognize cascade-delete operations. If you want to delete a row in a table that has constraints against it, you must either set the ON DELETE CASCADE rule in the foreign-key constraint in the database, or use your own code to first delete the child objects that prevent the parent object from being deleted. Otherwise, an exception is thrown.

.NET Framework
Available since 3.5
Windows Phone Silverlight
Available since 7.1
Return to top