SqlPersonalizationProvider.ResetState Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Deletes personalization state information from the underlying data store, based on the specified parameters.
public:
override int ResetState(System::Web::UI::WebControls::WebParts::PersonalizationScope scope, cli::array <System::String ^> ^ paths, cli::array <System::String ^> ^ usernames);
public override int ResetState (System.Web.UI.WebControls.WebParts.PersonalizationScope scope, string[] paths, string[] usernames);
override this.ResetState : System.Web.UI.WebControls.WebParts.PersonalizationScope * string[] * string[] -> int
Public Overrides Function ResetState (scope As PersonalizationScope, paths As String(), usernames As String()) As Integer
Parameters
- scope
- PersonalizationScope
A PersonalizationScope indicating the personalization information to be queried. This value cannot be null
.
Returns
The number of rows deleted.
Exceptions
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.
The scope
specified is not a member of the PersonalizationScope enumeration.
Remarks
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 tonull
. This combination deletes all Web Parts personalization data associated with the personalization scope indicated byscope
.The
scope
parameter is set, and thepaths
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 byscope
.The
scope
parameter is set to User, thepaths
parameter is set and contains only one path, and theusernames
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 inusernames
.The
scope
parameter is set to User, thepaths
parameter isnull
, and theusernames
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 inusernames
.
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 thescope
parameter is set to Shared.The
paths
parameter cannot contain more than one entry when theusernames
parameter is notnull
.
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:
null
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.