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



Teradata.Client.Provider Namespace > TdConnection Class : DataSource Property
Gets the Teradata server (a.k.a DBC Name TDPID) name.
Syntax
'Declaration
 
Public Overrides NotOverridable ReadOnly Property DataSource As String
'Usage
 
Dim instance As TdConnection
Dim value As String
 
value = instance.DataSource
public override string DataSource {get;}
public:
property String^ DataSource {
   String^ get() override;
}

Property Value

The Teradata server name utilized during a TdConnection.Open. This value is also the Teradata server name utilized during the establishment of a Teradata connection. The default value is an empty string.
Remarks
DataSource is required and is set via the TdConnection.ConnectionString property. The DataSource is the Teradata server name.
Example
The following example creates an instance of the TdConnection class, sets the DataSource property via the ConnectionString property and opens a connection to the Advanced SQL Engine. It later displays the DataSource property.

public TdConnection CreateTdConnection()
{
    TdConnection cn = new TdConnection();
            
    cn.ConnectionString = “Data Source=Teradata1;User Id=ca;Password=ca;”;
            
    cn.Open();
            
    Console.WriteLine(“Opened a Teradata session to {0}”, cn.DataSource);
            
    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