FRAMES | NO FRAMES
CreateProject Method

Creates a new project.

Availability: Business Analyst Server.

void CreateProject ( 
    string  WorkspaceName, 
    string  ProjectName 
); 

Parameter Description
WorkspaceName Workspace name. Type String.
ProjectName Name of a new project. Type String.

Remarks

If the project to create already exists, this method throws an exception.

Examples

The example below creates a new project in the Business Analyst Repository.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
 
string workspace = "Default Workspace";
string newProject = "project_CreateProject";
 
// The CreateProject method throws an exception if the project already exists.
// Before creating this project we try to remove it just in case.
try { baServerHelper.DeleteProject(workspace, newProject); }
catch { }
 
// Now create a new project.
baServerHelper.CreateProject(workspace, newProject);
 
// Get the list of all projects and ensure that the given project exists.
string[] projects = baServerHelper.GetProjects(workspace);
bool projectFound = Array.IndexOf(projects, newProject) >= 0;
 
// Remove the project.
baServerHelper.DeleteProject(workspace, newProject);

See Also