Export (0) Print
Expand All

ProfileProviderCollection Class

A collection of objects that inherit the ProfileProvider abstract class.

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

public sealed class ProfileProviderCollection : SettingsProviderCollection
public final class ProfileProviderCollection extends SettingsProviderCollection
public final class ProfileProviderCollection extends SettingsProviderCollection
Not applicable.

The profile providers for an application are exposed as a read-only ProfileProviderCollection through the Providers property of the ProfileManager class. You can access a specific profile provider in the collection by name and cast it as the specific provider type, such as SqlProfileProvider. This enables you to manage user profile properties from multiple data stores in a single application. It also allows you to access members of a specific profile provider that are not members of the ProfileProvider abstract class.

The following code example lists the providers enabled for an application and their respective types.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Profile" %>
<%@ Import Namespace="System.Configuration.Provider" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>List Enabled Providers</title>
</head>
<body>

<%
foreach (ProviderBase p in ProfileManager.Providers)
  Response.Write(p.Name + ", " + p.GetType() + "<br />");
%>

</body>
</html>

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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:
© 2014 Microsoft