WMIConn 建構
Initializes a new instance of the WMIConn class.
命名空間: Microsoft.SqlServer.Dts.ManagedConnections
組件: Microsoft.SqlServer.ManagedConnections (在 Microsoft.SqlServer.ManagedConnections.dll 中)
語法
'宣告
Public Sub New
'用途
Dim instance As New WMIConn()
public WMIConn()
public:
WMIConn()
new : unit -> WMIConn
public function WMIConn()
範例
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)