SqlProfileProvider.GetPropertyValues Metodo

Definizione

Recupera le informazioni e i valori delle proprietà del profilo da un database di profili di 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

Parametri

sc
SettingsContext

Oggetto SettingsContext che contiene informazioni sul profilo utente.

properties
SettingsPropertyCollection

Oggetto SettingsPropertyCollection che contiene informazioni sulle proprietà del profilo da recuperare.

Restituisce

Un oggetto SettingsPropertyValueCollection che contiene le informazioni e i valori delle proprietà del profilo.

Esempio

Nell'esempio di codice seguente sono elencate le proprietà e i valori del profilo identificati nel profilo corrente.

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

Commenti

Il GetPropertyValues metodo viene usato dalla ProfileBase classe per recuperare le proprietà del profilo per la richiesta corrente gestita da SqlProfileProvider. I valori delle proprietà vengono restituiti dall'origine dati per l'applicazione specificata dall'attributo applicationName nel file di configurazione. I valori delle proprietà e le informazioni aggiuntive sulle proprietà vengono restituiti come raccolta di SettingsPropertyValue oggetti.

Si applica a

Vedi anche