FRAMES | NO FRAMES
CreateItem Method

Creates a new repository item. This method is deprecated.

Availability: Business Analyst Server.

void CreateItem ( 
    string          WorkspaceName, 
    string          ProjectName, 
    esriFolderType  FolderType, 
    string          ItemName 
);

Parameter Description
WorkspaceName Workspace name. Type String.
ProjectName Project name. Type String.
FolderType Folder type to create item in. Type esriFolderType.
ItemName Item name. Type String.

Remarks

If the item to create already exists, this method has no effect.

Examples

The example below creates an "empty" store layer in the Default Project of the Default Workspace of the repository.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
 
string workspace = "Default Workspace";
string project = "Default Project";
esriFolderType itemType = esriFolderType.esriFolderStoreLayers;
string itemName = "item_CreateItem";
 
// Create a new item
baServerHelper.CreateItem(workspace, project, itemType, itemName);
 
// Get the list of all items and ensure that the given item exists
esriFolderItem[] items = baServerHelper.GetListProjectItems(workspace, project, itemType);
bool itemFound = false;
foreach (esriFolderItem item in items)
    if (item.itemName == itemName)
    {
        itemFound = true;
        break;
    }
 
// Delete the item that was created
baServerHelper.DeleteItem(workspace, project, itemType, itemName);

See Also