PersonalizationAdministration.ResetState(PersonalizationStateInfoCollection) 方法

定义

以集合中包含的项为基础,重置数据存储中的个性化数据。Resets personalization data in the underlying data store, based on the items contained in the collection.

public:
 static int ResetState(System::Web::UI::WebControls::WebParts::PersonalizationStateInfoCollection ^ data);
public static int ResetState (System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection data);
static member ResetState : System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection -> int
Public Shared Function ResetState (data As PersonalizationStateInfoCollection) As Integer

参数

data
PersonalizationStateInfoCollection

PersonalizationStateInfo 对象的集合,指示应重置的数据。A collection of PersonalizationStateInfo objects indicating what data should be reset.

返回

Int32

已重置的行数。The number of rows that were reset.

例外

datanulldata is null.

data 为空集合。data is an empty collection.

- 或 --or-

集合中的一个元素为 nullAn element of the collection is null.

- 或 --or-

集合中 UserPersonalizationStateInfo 实例的路径值为 null 或为空字符串 ("")。The path value of a UserPersonalizationStateInfo instance in the collection is null or an empty string ("").

- 或 --or-

集合中 UserPersonalizationStateInfo 实例的 user 值为 null、空字符串,或含有逗号。The user value of a UserPersonalizationStateInfo instance in the collection is null, an empty string, or contains commas.

- 或 --or-

配置中定义的个性化设置提供程序的提供程序类型不正确。The provider for a personalization provider defined in configuration is not of the correct type.

- 或 --or-

任何参数的字符串长度超过 256 个字符。The length of the string of any parameter is greater than 256 characters.

尝试创建和初始化已配置的个性化设置提供程序的一个实例时出现配置异常。A configuration exception occurred while attempting to create and initialize an instance of one of the configured personalization providers.

- 或 --or-

找不到配置中定义的默认个性化设置提供程序。The default personalization provider defined in configuration could not be found.

默认提供程序指示删除的行数是负数。The default provider indicated that the number of deleted rows was a negative number.

注解

此方法根据集合中包含的对象重置基础数据存储区中的个性化设置数据 PersonalizationStateInfoThis method resets personalization data in the underlying data store, based on the PersonalizationStateInfo objects contained in the collection. 您可以使用此方法根据集合的内容有选择地删除共享和每用户数据的混合。You can use this method to selectively delete a mixture of shared and per-user data based on the collection's contents. SharedPersonalizationStateInfo 对象指示将重置页面的共享数据; UserPersonalizationStateInfo 对象指示将重置特定页面的每用户数据。SharedPersonalizationStateInfo objects indicate that shared data for a page will be reset; UserPersonalizationStateInfo objects indicate that per-user data for a specific page will be reset.

备注

此方法不保证在单个事务中发生所有重置,因为该集合指向随机的个性化设置数据集。This method does not guarantee that all resets occur within a single transaction because the collection points to random sets of personalization data.

如果集合中包含的对象引用不存在的数据,则不是错误。It is not an error for the collection to contain objects that reference nonexistent data.

适用于

另请参阅