System.Data.OleDb.OleDbCommand.Connection Property

Gets or sets the System.Data.OleDb.OleDbConnection used by this instance of the System.Data.OleDb.OleDbCommand.

Syntax

[System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, 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 OleDbConnection Connection { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

You cannot set the OleDbCommand.Connection, OleDbCommand.CommandType and OleDbCommand.CommandText properties if the current connection is performing an execute or fetch operation.

If you set OleDbCommand.Connection while a transaction is in progress and the OleDbCommand.Transaction property is not null, an InvalidOperationException is generated. If the OleDbCommand.Transaction property is not null and the transaction has already been committed or rolled back, OleDbCommand.Transaction is set to null.

Requirements

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