Click to Rate and Give Feedback
MSDN
MSDN Library

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Prepare Method
[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Creates a prepared (or compiled) version of the command on the data source.

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

C#
public override void Prepare ()
Visual Basic (Declaration)
Public Overrides Sub Prepare
Visual Basic (Usage)
Dim instance As SqlCeCommand

instance.Prepare
Visual C++
public:
virtual void Prepare () override
JScript
public override function Prepare ()
ExceptionCondition
InvalidOperationException

The Connection is not set.

-or -

The Connection is not Open.

If the CommandType property is set to TableDirect, Prepare does nothing.

Before you call Prepare, specify the data type of each parameter in the statement to be prepared. For each parameter that has a variable-length data type, you must set the Size property to the maximum size needed. Prepare returns an error if these conditions are not met.

If you call an Execute method after calling Prepare, any parameter value that is larger than the value specified by the Size property is automatically truncated to the original specified size of the parameter, and no truncation errors are returned.

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

Reference

SqlCeCommand Class
SqlCeCommand Members
System.Data.SqlServerCe Namespace
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker