System.Data.Odbc.OdbcDataAdapter.InsertCommand Property

Gets or sets an SQL statement or stored procedure used to insert new records into the data source.

Syntax

[System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.DBCommandEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DefaultValue(null)]
public OdbcCommand InsertCommand { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the OdbcDataAdapter.InsertCommand property is assigned to a previously created System.Data.Odbc.OdbcCommand object, the System.Data.Odbc.OdbcCommand is not cloned. Instead, OdbcDataAdapter.InsertCommand maintains a reference to the previously created System.Data.Odbc.OdbcCommand.

During an update operation, if OdbcDataAdapter.InsertCommand is not set and primary key information is present in the System.Data.DataSet, you can use the System.Data.Odbc.OdbcCommandBuilder class to automatically generate OdbcDataAdapter.InsertCommand, and additional commands needed to reconcile the System.Data.DataSet to the data source. To do this, set the OdbcDataAdapter.SelectCommand property of the System.Data.Odbc.OdbcDataAdapter. The generation logic also requires key column information to be present in the System.Data.DataSet. For more information, see Automatically Generating Commands.

Note:

If execution of this command returns rows, these rows may be added to the System.Data.DataSet depending upon how you set the OdbcCommand.UpdatedRowSource property of the System.Data.Odbc.OdbcCommand object.

Requirements

Namespace: System.Data.Odbc
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0