Password プロパティ

Windows 認証を使用しない場合、接続のパスワードを設定します。

名前空間:  Microsoft.SqlServer.Dts.ManagedConnections
アセンブリ:  Microsoft.SqlServer.ManagedConnections (Microsoft.SqlServer.ManagedConnections.dll)

構文

'宣言
Public WriteOnly Property Password As String
    Set
'使用
Dim instance As WMIConn
Dim value As String

instance.Password = value
public string Password { set; }
public:
property String^ Password {
    void set (String^ value);
}
member Password : string with get, set
function set Password (value : String)

プロパティ値

型: System. . :: . .String
接続のパスワードを表す String です。

説明

Windows 認証を使用しない場合、接続に使用するパスワードを入力する必要があります。

使用例

次のコード例では、パッケージに WMI 接続を追加し、ServerName プロパティ、UserName プロパティ、および Password プロパティを設定します。コード例は、アプリケーションに応じた適切な値がプロパティに設定されるように変更する必要があります。

ConnectionManager WmiConn = pkg.Connections.Add("WMI");
DtsProperty prop = WmiConn.Properties["ServerName"];
prop.SetValue(WmiConn, @"\\localhost");
WmiConn.Properties["Username"].SetValue(WmiConn, @"");
WmiConn.Properties["Password"].SetValue(WmiConn, @"");
Dim WmiConn As ConnectionManager =  pkg.Connections.Add("WMI") 
Dim prop As DtsProperty =  WmiConn.Properties("ServerName") 
prop.SetValue(WmiConn, "\\localhost")
WmiConn.Properties("Username").SetValue(WmiConn, @"")
WmiConn.Properties("Password").SetValue(WmiConn, @"")