Version

RemoveResource(Resource) Method

Deletes an existing Resource permanently from the database, and detaches it from any related Activities.
Syntax
'Declaration
 
Public Overloads Sub RemoveResource( _
   ByVal resource As Resource _
) 
public void RemoveResource( 
   Resource resource
)

Parameters

resource
A resource originating from the database that has a current, valid DataKey and is to be removed from the database.
Exceptions
ExceptionDescription
System.ArgumentExceptionThrown when the resource contains a null reference (or Nothing in Visual Basic .NET) for it's Name property. A non-null Name must be specified to identify an existing Resource row to delete from the data store.
System.ArgumentNullExceptionThrown when the resource was supplied as a null reference (or Nothing in Visual Basic .NET). An Resource must be non-null to specify it's Name to delete.
Remarks

The supplied resource must have a valid DataKey that can be used to identify it's current place in the Resource table. This method deletes a single row from the Resource table based on the DataKey. It does not perform extra checking to confirm that the supplied Resource instance matches the row within the Resource table field-for-field.

References within the ActivityResource table to the resource being deleted will be replaced by references to the UnassignedResource. This effectively disconnects the Activity from it's Resource. Depending on scheduling application requirements, Administrators may periodically need to clean-up rows in the Activity table associated with the UnassignedResource as resources are removed from the application over time.

Deleting the UnassignedResource from the Resource table is not programmatically supported. Any attempt to remove the UnassignedResource row from the Resource table jeopardizes data model integrity as it's presence is required by several operations.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also