OdbcCommand.Connection Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the OdbcConnection used by this instance of the OdbcCommand.
public:
property System::Data::Odbc::OdbcConnection ^ Connection { System::Data::Odbc::OdbcConnection ^ get(); void set(System::Data::Odbc::OdbcConnection ^ value); };
public System.Data.Odbc.OdbcConnection? Connection { get; set; }
public System.Data.Odbc.OdbcConnection Connection { get; set; }
member this.Connection : System.Data.Odbc.OdbcConnection with get, set
Public Property Connection As OdbcConnection
The connection to a data source. The default is a null value.
The Connection property was changed while a transaction was in progress.
You cannot set the Connection, CommandType, and CommandText properties if the current connection is performing an execute or fetch operation.
If you set Connection while a transaction is in progress and the Transaction property is not null, an InvalidOperationException is generated. If you set Connection after the transaction has been committed or rolled back, and the Transaction property is not null, the Transaction property is then set to a null value.
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: