Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Add Method
Collapse the table of content
Expand the table of content

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
)

Parameters

profileInfo
Type: System.Web.Profile.ProfileInfo
A ProfileInfo object to add to the collection.

ExceptionCondition
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 null.

-or-

The UserName property of profileInfo is null.

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.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft