Send feedback on this topic.
Teradata.Client.Provider
Connection Property (TdCommand)



Teradata.Client.Provider Namespace > TdCommand Class : Connection Property
Gets or sets the TdConnection instance used to execute the command.
Syntax
'Declaration
 
Public Shadows Property Connection As TdConnection
'Usage
 
Dim instance As TdCommand
Dim value As TdConnection
 
instance.Connection = value
 
value = instance.Connection
public new TdConnection Connection {get; set;}
public:
new property TdConnection^ Connection {
   TdConnection^ get();
   void set (    TdConnection^ value);
}

Property Value

The connection to the Advanced SQL Engine. The default value is null.
Exceptions
ExceptionDescription
The Connection property was changed while the TdCommand was in execute state or there is an outstanding associated TdDataReader.
The TdCommand is closed / disposed.
Remarks

You cannot set the Connection, CommandType or CommandText properties if TdCommand is executing a SQL statement or if there is an outstanding TdDataReader instance. TdDataReader should be closed before Connection property is changed.

The Transaction property is set to null when the Transaction property is not null and has already been committed or rolled back.

Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdCommand Class
TdCommand Members