ProfileInfoCollection::Add Method
Adds the specified ProfileInfo object to the collection.
Assembly: System.Web (in System.Web.dll)
Parameters
- profileInfo
- Type: System.Web.Profile::ProfileInfo
A ProfileInfo object to add to the collection.
| Exception | Condition |
|---|---|
| System::NotSupportedException | The collection is read-only. |
| System::ArgumentException | A ProfileInfo object with the same UserName value as profileInfo already exists in the collection. |
| System::ArgumentNullException | profileInfo is nullptr. -or- The UserName property of profileInfo is nullptr. |
The Add method is commonly used by profile-provider implementers to populate a ProfileInfoCollection to return from the GetAllProfiles, GetAllInactiveProfiles, FindProfilesByUserName, or FindInactiveProfilesByUserName method of the ProfileProvider abstract class.
For an example of a ProfileProvider implementation that creates a ProfileInfoCollection for user profiles in a data store, see Implementing a Profile Provider.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.