Remove(String) Method

The Remove method of the AudienceCollection class removes the audience with the specified name from the collection.

Parameters

AudienceName   Audience name.

Exceptions

Exception Type Condition
AudienceInCompilationException Audience is in use and cannot be removed at this time.
AudienceNotExistException Audience with specified GUID does not exist in the database.
AudienceExecutionException Removal failed. The message for this exception contains an error code that specifies the reason the method failed.
UnauthorizedAccessException Current user only has read access rights on the current portal site and cannot remove an audience.

Remarks

The Remove method fails if the user is not a member of the Administrator site group for the SharePoint site.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security