SqlPersonalizationProvider.ResetState Method

Deletes personalization state information from the underlying data store, based on the specified parameters.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public:
virtual int ResetState (
	PersonalizationScope scope, 
	array<String^>^ paths, 
	array<String^>^ usernames
) override
public int ResetState (
	PersonalizationScope scope, 
	String[] paths, 
	String[] usernames
)
public override function ResetState (
	scope : PersonalizationScope, 
	paths : String[], 
	usernames : String[]
) : int
Not applicable.

Parameters

scope

A PersonalizationScope indicating the personalization information to be queried. This value cannot be a null reference (Nothing in Visual Basic).

paths

The paths for personalization information in the Shared scope to be deleted.

usernames

The user names for personalization information in the User scope to be deleted.

Return Value

The number of rows deleted.

Exception typeCondition

ArgumentException

Either the paths or the usernames parameter is an empty array.

- or -

The paths and usernames parameters contained within the respective arrays do not meet the validation rules.

ArgumentOutOfRangeException

The scope specified is not a member of the PersonalizationScope enumeration.

No wildcard characters are supported by this method.

Only the following combinations of parameters are allowed:

  • The scope parameter is set, and all other parameters are set to a null reference (Nothing in Visual Basic). This combination deletes all Web Parts personalization data associated with the personalization scope indicated by scope.

  • The scope parameter is set, and the paths parameter contains at least one value. This combination deletes all Web Parts personalization data for the specified path or paths that are in the personalization scope indicated by scope.

  • The scope parameter is set to User, the paths parameter is set and contains only one path, and the usernames parameter contains at least one value. This combination deletes all user personalization Web Parts data for the given path that is associated with the user or users contained in usernames.

  • The scope parameter is set to User, the paths parameter is a null reference (Nothing in Visual Basic), and the usernames parameter contains at least one value. This combination deletes all per-user personalization Web Parts data, across all paths, associated with the user or users contained in usernames.

Any other combination of parameter values is invalid and will throw an ArgumentException exception. For example, the following two combinations are not allowed:

  • The usernames parameter cannot be provided when the scope parameter is set to Shared.

  • The paths parameter cannot contain more than one entry when the usernames parameter is not a null reference (Nothing in Visual Basic).

The paths and usernames parameters contained within the respective arrays must meet the following validation rules. If any validation rules fail for any member of the parameter arrays, an ArgumentException exception is thrown. The validation rules include:

  • a null reference (Nothing in Visual Basic) values are not allowed.

  • An empty string ("") after the string has been trimmed is not allowed.

  • No user names contained in the usernames parameter can contain commas.

  • The length of any path in the paths parameter cannot be greater than 256 characters.

  • The length of any user name in the usernames parameter cannot be greater than 256 characters.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: