Condividi tramite


SqlCeCommandBuilder.GetInsertCommand Method

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets the automatically generated SqlCeCommand object required to perform inserts on the database when an application calls Update on the SqlCeDataAdapter.

  [Visual Basic]
  Public Function GetInsertCommand() As SqlCeCommand
[C#]
public SqlCeCommand GetInsertCommand();
[C++]
public: SqlCeCommand* GetInsertCommand();
[JScript]
public function GetInsertCommand() : SqlCeCommand;

Return Value

The automatically generated SqlCeCommand object required to perform inserts.

Remarks

An application can use the GetInsertCommand method for informational or troubleshooting purposes because it returns the SqlCeCommand object to be executed.

You can also use GetInsertCommand as the basis of a modified command. For example, you might call GetInsertCommand and modify one of its properies, and then explicitly set that on the SqlCeDataAdapter.

After the SQL statement is first generated, the application must explicitly call RefreshSchema if the application changes the statement in any way. Otherwise, the GetInsertCommand still uses information from the previous statement, and that information might not be correct. The SQL statements are first generated when the application calls either Update or GetInsertCommand.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeCommandBuilder Class | SqlCeCommandBuilder Members | System.Data.SqlServerCe Namespace

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.