ServerName プロパティ

WMI 接続として接続するサーバーの名前を取得します。値の設定も可能です。

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

構文

'宣言
Public Property ServerName As String
    Get
    Set
'使用
Dim instance As WMIConn
Dim value As String

value = instance.ServerName

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

プロパティ値

型: System. . :: . .String
WMI 接続として接続するサーバーの名前を表す String です。

使用例

次のコード例では、パッケージに WMI 接続を追加し、ServerName プロパティ、Namespace プロパティ、および UseWindowsAuth プロパティを設定します。

ConnectionManager WmiConn = pkg.Connections.Add("WMI");
DtsProperty prop = WmiConn.Properties["ServerName"];
prop.SetValue(WmiConn, @"\\localhost");
WmiConn.Properties["Namespace"].SetValue(WmiConn, @"\root\myfolder");
WmiConn.Properties["UseWindowsAuth"].SetValue(WmiConn, true);
Dim WmiConn As ConnectionManager =  pkg.Connections.Add("WMI") 
Dim prop As DtsProperty =  WmiConn.Properties("ServerName") 
prop.SetValue(WmiConn, "\\localhost")
WmiConn.Properties("Namespace").SetValue(WmiConn, "\root\myfolder")
WmiConn.Properties("UseWindowsAuth").SetValue(WmiConn, True)