SqlProfileProvider.GetPropertyValues Metoda

Definicja

Pobiera informacje o właściwościach profilu i wartości z bazy danych profilów programu SQL Server.

public:
 override System::Configuration::SettingsPropertyValueCollection ^ GetPropertyValues(System::Configuration::SettingsContext ^ sc, System::Configuration::SettingsPropertyCollection ^ properties);
public override System.Configuration.SettingsPropertyValueCollection GetPropertyValues (System.Configuration.SettingsContext sc, System.Configuration.SettingsPropertyCollection properties);
override this.GetPropertyValues : System.Configuration.SettingsContext * System.Configuration.SettingsPropertyCollection -> System.Configuration.SettingsPropertyValueCollection
Public Overrides Function GetPropertyValues (sc As SettingsContext, properties As SettingsPropertyCollection) As SettingsPropertyValueCollection

Parametry

sc
SettingsContext

Element SettingsContext zawierający informacje o profilu użytkownika.

properties
SettingsPropertyCollection

Informacje SettingsPropertyCollection o profilu, które mają zostać pobrane.

Zwraca

Zawiera SettingsPropertyValueCollection informacje o właściwości profilu i wartości.

Przykłady

Poniższy przykład kodu zawiera listę właściwości i wartości profilu zidentyfikowanych w bieżącym profilu.

SqlProfileProvider p = 
  (SqlProfileProvider)Profile.Providers["SqlProvider"];

SettingsPropertyValueCollection pvalues = 
      p.GetPropertyValues(Profile.Context, ProfileBase.Properties);

foreach (SettingsPropertyValue pval in pvalues)
{
  Response.Write(pval.Name + " = " + pval.PropertyValue + "<br />");
} 
Dim p As SqlProfileProvider = _
  CType(Profile.Providers("SqlProvider"), SqlProfileProvider)

Dim pvalues As SettingsPropertyValueCollection = _
  p.GetPropertyValues(Profile.Context, ProfileBase.Properties)

For Each pval As SettingsPropertyValue In pvalues
  Response.Write(pval.Name & " = " & pval.PropertyValue.ToString() & "<br />")
Next

Uwagi

Metoda GetPropertyValues jest używana przez klasę ProfileBase do pobierania właściwości profilu dla bieżącego żądania zarządzanego SqlProfileProviderprzez program . Wartości właściwości są zwracane ze źródła danych aplikacji określonej przez applicationName atrybut w pliku konfiguracji. Wartości właściwości i dodatkowe informacje o właściwości są zwracane jako kolekcja SettingsPropertyValue obiektów.

Dotyczy

Zobacz też