다음을 통해 공유


ConnectionManagerBase.ConnectionString 속성

Gets or sets the connection string for the connection.

네임스페이스:  Microsoft.SqlServer.Dts.Runtime
어셈블리:  Microsoft.SqlServer.ManagedDTS(Microsoft.SqlServer.ManagedDTS.dll)

구문

‘선언
Public Overridable Property ConnectionString As String 
    Get 
    Set
‘사용 방법
Dim instance As ConnectionManagerBase 
Dim value As String 

value = instance.ConnectionString

instance.ConnectionString = value
public virtual string ConnectionString { get; set; }
public:
virtual property String^ ConnectionString {
    String^ get ();
    void set (String^ value);
}
abstract ConnectionString : string with get, set 
override ConnectionString : string with get, set
function get ConnectionString () : String 
function set ConnectionString (value : String)

속성 값

유형: System.String
A String that contains the connection string.

주의

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 SQL Server Data Tools and examine its ConnectionString property in the Properties window.

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

참고 항목

참조

ConnectionManagerBase 클래스

Microsoft.SqlServer.Dts.Runtime 네임스페이스