FRAMES | NO FRAMES
DeleteProject Method

Deletes a project.

Availability: Business Analyst Server.

void DeleteProject ( 
    string  WorkspaceName,
    string  ProjectName	
); 

Parameter Description
WorkspaceName Workspace name. Type String.
ProjectName Name of project to delete. Type String.

Remarks

If the project to delete is absent, this method throws an exception. Additionally, if the "Default Project" is deleted, all of its contents (folder items, etc.) will be deleted and this project will be recreated on the next full reload.

Examples

The example below demonstrates the deletion of an existing project in the Business Analyst Server Repository.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
 
string workspace = "Default Workspace";
string deletedProject = "existingProject_DeleteProject";
 
// The DeleteProject method throws an exception if the project is absent.
// So, before deleting this project we try to create it
try { baServerHelper.CreateProject(workspace, deletedProject); }
catch { }
 
// Delete the project
baServerHelper.DeleteProject(workspace, deletedProject);
 
// Get the list of all projects and ensure that the given project is absent
string[] projects = baServerHelper.GetProjects(workspace);
bool projectDeleted = Array.IndexOf(projects, deletedProject) < 0;

See Also