Поделиться через


Свойство ServerName

Gets or sets the name of the server to connect to as a WMI connection.

Пространство имен:  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
A String that contains the name of the server to connect to as a WMI connection.

Примеры

The following code example adds a WMI connection to a package, and sets the ServerName, Namespace, and UseWindowsAuth properties.

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)