System.Data.Odbc.OdbcCommand.Connection Property

Gets or sets the System.Data.Odbc.OdbcConnection used by this instance of the System.Data.Odbc.OdbcCommand.

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 OdbcConnection Connection { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

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

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

Requirements

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