Share via


Application.RemoveFromSqlServer(String, String, String, String) 方法

定义

从指定的 SQL Server 实例中删除包。

public:
 void RemoveFromSqlServer(System::String ^ packagePath, System::String ^ serverName, System::String ^ serverUserName, System::String ^ serverPassword);
public void RemoveFromSqlServer (string packagePath, string serverName, string serverUserName, string serverPassword);
member this.RemoveFromSqlServer : string * string * string * string -> unit
Public Sub RemoveFromSqlServer (packagePath As String, serverName As String, serverUserName As String, serverPassword As String)

参数

packagePath
String

要删除的包的名称。

serverName
String

SQL Server 实例的名称。

serverUserName
String

对服务器进行身份验证时要使用的用户名。

serverPassword
String

serverUserName 帐户关联的密码。

示例

下面的代码示例删除之前保存的包 myNewName

static void Main(string[] args)  
{  
    Application app = new Application();  
    // The package was previously saved using this method call.  
    //app.SaveToSqlServerAs(p1, null, "myNewName", "yourserver", null, null);  

    // Remove the previously saved package.  
    app.RemoveFromSqlServer("myNewName", "yourserver", null, null);  
}  
Shared  Sub Main(ByVal args() As String)  
    Dim app As Application =  New Application()   
    ' The package was previously saved using this method call.  
    'app.SaveToSqlServerAs(p1, null, "myNewName", "yourserver", null, null);  

    ' Remove the previously saved package.  
    app.RemoveFromSqlServer("myNewName", "yourserver", Nothing, Nothing)  
End Sub  

适用于