ProfileInfoCollection.Add Method

Adds the specified ProfileInfo object to the collection.

Namespace: System.Web.Profile
Assembly: System.Web (in system.web.dll)

public:
void Add (
	ProfileInfo^ profileInfo
)
public void Add (
	ProfileInfo profileInfo
)
public function Add (
	profileInfo : ProfileInfo
)
Not applicable.

Parameters

profileInfo

A ProfileInfo object to add to the collection.

Exception typeCondition

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 a null reference (Nothing in Visual Basic).

-or-

The UserName property of profileInfo is a null reference (Nothing in Visual Basic).

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 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: