Export (0) Print
Expand All

DataContext.ExecuteDynamicInsert Method

Called inside insert override methods to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for insert operations.

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

'Declaration
Protected Friend Sub ExecuteDynamicInsert ( _
	entity As Object _
)
'Usage
Dim entity As Object 

Me.ExecuteDynamicInsert(entity)

Parameters

entity
Type: System.Object

The entity to be inserted.

Note the following considerations:

  • Because the method has a protected modifier, its use requires subclassing DataContext.

  • An exception is thrown if this operation is not called inside a SubmitChanges operation. It is not intended to be called as a stand-alone operation outside the scope of a SubmitChanges operation. SubmitChanges itself calls override methods if they are implemented and the previous methods are intended to be called inside the override methods.

  • It is the responsibility of the developer to pass in the correct entity. The implementation verifies that the passed-in entity is tracked. However, it is the responsibility of the developer to maintain the order or pass in the same entity two times.

  • It is the responsibility of the developer to invoke the correct dynamic API. For example, in the Update override method, only the ExecuteDynamicUpdate method can be called. LINQ to SQL does not detect or verify whether the invoked dynamic method matches the applicable operation. The results are undefined if an inapplicable method is called (for example, calling ExecuteDynamicDelete for an object to be updated).

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft