Send feedback on this topic.
Teradata.Client.Provider
ConnectionTimeout Property (TdConnection)
Example 



Teradata.Client.Provider Namespace > TdConnection Class : ConnectionTimeout Property
Returns connection timeout value set in the connection string. Zero indicates an indefinite timeout period.
Syntax
'Declaration
 
Public Overrides NotOverridable ReadOnly Property ConnectionTimeout As Integer
'Usage
 
Dim instance As TdConnection
Dim value As Integer
 
value = instance.ConnectionTimeout
public override int ConnectionTimeout {get;}
public:
property int ConnectionTimeout {
   int get() override;
}

Property Value

Specifies the maximum amount of time in seconds for establishment of a Teradata session. The default value is 20 seconds.
Remarks

This property is set via the TdConnection.ConnectionString. It can be set to any positive value including 0. If it is set to zero, the TdConnection instance will wait indefinitely for a session to be established. However, we don’t recommend setting this number to 0 because it can block the application indefinitely. The application should set this number to an appropriate value.

The default ConnectionTimeout may be changed through support in our application configuration file Application Configuration File ConnectionTimeout. The TdConnectionStringBuilder.ConnectionTimeout will have priority over the Application Configuration file ConnectionTimeout property.

Example
The following example creates an instance of the TdConnection class, sets the ConnectionTimeout property and opens a connection to the Advanced SQL Engine.

public TdConnection CreateTdConnection()
{
    TdConnection cn = new TdConnection();
            
    cn.ConnectionString = “Data Source=Teradata1;User ID=ca;Password=ca;Connection Timeout=30;”;
            
    cn.Open();
            
    return cn;
}
Requirements

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

See Also

Reference

TdConnection Class
TdConnection Members