SqlProfileProvider::DeleteProfiles Method (array<String^>^)
Deletes profile properties and information from the data source for the supplied list of user names.
Assembly: System.Web (in System.Web.dll)
Parameters
- usernames
-
Type:
array<System::String^>^
A string array of user names for profiles to be deleted.
| Exception | Condition |
|---|---|
| ArgumentException | The length of usernames is zero. - or - One of the items in usernames is an empty string (""), exceeds a length of 256 characters, or contains a comma. - or - Two or more items in usernames have the same value. |
| ArgumentNullException | usernames is null. - or - One of the items in usernames is null. |
The DeleteProfiles method deletes all profile information and properties for the specified profiles from the data source for the application specified by the applicationName attribute in the configuration file. The list of profiles to delete is specified as a string array of user names. If profile properties and information exist in the data source for a user name in the usernames parameter, they are deleted.
The return value may differ from the length of the specified array of usernames. This indicates that some of the profiles in the specified array of usernames were already deleted from the data store.
The database updates that are performed during the call to the DeleteProfiles method are made within a transaction. If an error is encountered, the transaction is rolled back and no updates are performed.
Available since 2.0