Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

EntityCommand.Prepare Method

Compiles the entity-level command and creates a prepared version of the command by calling the Prepare method of the underlying data provider's Command object.

Namespace:  System.Data.EntityClient
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public override void Prepare()

Implements

IDbCommand.Prepare()

ExceptionCondition
InvalidOperationException

The associated EntityConnection is closed.

Client-side command compilation consists of the following steps:

  1. Building a command tree from the specified Entity SQL command text if it has not already been built.

  2. Getting the provider factory from the EntityConnection object and using it to create a DbCommandDefinition object. However, if EntityCommand is already associated with a DbCommandDefinition, this step is skipped.

  3. Setting the command tree, parameters, and other settings on the [T:System.Data.Common DbCommandDefinition] object.

  4. Adding the compiled query plan to the cache, if query plan caching is enabled.

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 SP1

Community Additions

ADD
Show:
© 2015 Microsoft