FindState
This method returns a collection containing zero or more PersonalizationStateInfo-derived objects based on scope and specific query parameters.
                  
Declaration
// C# public override PersonalizationStateInfoCollection FindState(PersonalizationScope scope, PersonalizationStateQuery query, int pageIndex, int pageSize, out int totalRecords);
Parameters
- 
                        scopeThe scope of query (User or Shared) for personalization information. This cannot be a null reference. 
- 
                        queryThe query to be used for filtering personalization information. This can be a null reference. 
- 
                        pageIndexThe location where the query starts. 
- 
                        pageSizeThe number of records to return. 
- 
                        totalRecordsThe total number of records available. 
Return Value
A PersonalizationStateInfoCollection object containing zero or more PersonalizationStateInfo-derived objects.
                  
Exceptions
ArgumentOutOfRangeException - The scope contains a value other than PersonalizationScope.User or PersonalizationScope.Shared.
                  
OracleException - An Oracle-related error has occurred.
                  
ArgumentException - One of the following conditions exists:
                  
- 
                        The value of the pageSizeparameter is 0 or 1.
- 
                        The pageIndexorpageSizeparameter is less than 0.
- 
                        (( pageIndex * pageSize + pageSize) - 1) is greater thanInt32.MaxValue. -1 accounts for zero-based indexing of records.
Remarks
The PersonalizationStateInfo-derived objects should be returned in alphabetic order and sorted by a combination of their Path and Username property values, both in ascending order. 
                  
This method passes the query wildcard characters to the underlying Oracle database. The database performs a wildcard search on a partial path with the wildcard character appearing at the beginning, the end, or the middle of the search string text in the PathToMatch property of the query parameter. For example, setting the PathToMatch property to ~/appdir% finds all paths that start with ~/appdir.
                  
Likewise, in a wildcard search on a partial user name, the wildcard character can appear at any point in the text string of the UsernameToMatch property of the query parameter. For example, to find all user names that start with scott, the UsernameToMatch parameter looks like scott%.
                  
The following query rules must be followed:
- 
                        If only the scopeparameter is provided, and thequeryparameter is null or all the properties on thequeryparameter return either a null reference or default values, then all records matching the indicatedscopeparameter are returned.
- 
                        If the PathToMatchproperty is not a null reference, then the returned records are also filtered based on paths that match thePathToMatchvalue.
- 
                        If the UsernameToMatchproperty is not a null reference, then the returned records are also filtered based on user names that match theUsernameToMatchproperty value.
- 
                        If the UserInactiveSinceDateproperty is not equal to theMaxValue, then the records returned are also filtered to return only those records associated with inactive users. The comparison includes records where theLastActivityDateproperty is less than or equal to theUserInactiveSinceDateproperty.
This method does not validate combinations of query parameters. For example, the application code can request a set of personalization state records associated with a specific user name in the shared scope. Because user names are not associated with shared information, the returned collection is empty.