Partager via


ConnectionManagerBase.ConnectionString Property

Gets or sets the connection string for the connection.

Espace de noms: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

Syntaxe

'Déclaration
Public Overridable Property ConnectionString As String
public virtual string ConnectionString { get; set; }
public:
virtual property String^ ConnectionString {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_ConnectionString ()

/** @property */
public void set_ConnectionString (String value)
public function get ConnectionString () : String

public function set ConnectionString (value : String)

Valeur de propriété

A String that contains the connection string.

Notes

The format and contents of the connection string depend upon the data provider and the data source as well as the type of connection manager that is being created. To view a sample connection string, create a connection manager of the appropriate type in a package in BI Development Studio and examine its ConnectionString property in the Properties window.

Exemple

The following code example how to override the ConnectionString property for a custom connection manager, and shows a sample of what code may be in this property. Your code will vary.

public override string ConnectionString
    {
        get{return myConnectionString;}
    set
        {
            myConnectionString = value;
            myServer = myConnectionString;
            if(null != myServer && "" != myServer)
                {
                    mySmtpServer = myServer;
                }
            }
    }
Public Overrides Property ConnectionString() As String
    Get 
            Return myConnectionString
    End Get
    Set (ByVal Value As String) 
            myConnectionString = value
            myServer = myConnectionString
            If Nothing <> myServer And "" <> myServer Then
                    mySmtpServer = myServer
            End If
    End Set
End Property

Sécurité des threads

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

ConnectionManagerBase Class
ConnectionManagerBase Members
Microsoft.SqlServer.Dts.Runtime Namespace