Gets or sets the ADOConnection used by this instance of the ADOCommand.
[Visual Basic] Public Property ActiveConnection As ADOConnection [C#] public ADOConnection ActiveConnection {get; set;} [C++] public: __property ADOConnection* get_ActiveConnection(); public: __property void set_ActiveConnection(ADOConnection*); [JScript] public function get ActiveConnection() : ADOConnection; public function set ActiveConnection(ADOConnection);
The connection to the data source.
This property is not cloned, but copied. If the current ActiveConnection is not equal to the new connection, then a OnSchemaChanging event is raised. The connection properties are reset every time a new connection is assigned.
The following example creates an ADOCommand and sets some of its properties.
ADOCommand Class | ADOCommand Members | System.Data.ADO Namespace | CommandText | CommandTimeout | CommandType | RowFetchCount | CommandBehavior | NamedParameters