SqlProfileProvider.GetPropertyValues Yöntem

Tanım

Bir SQL Server profil veritabanından profil özelliği bilgilerini ve değerlerini alır.

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

Parametreler

sc
SettingsContext

SettingsContext Kullanıcı profili bilgilerini içeren.

properties
SettingsPropertyCollection

SettingsPropertyCollection Alınacak özellikler için profil bilgilerini içeren.

Döndürülenler

SettingsPropertyValueCollection Profil özelliği bilgilerini ve değerlerini içeren bir.

Örnekler

Aşağıdaki kod örneği, geçerli profilde tanımlanan profil özelliklerini ve değerlerini listeler.

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

Açıklamalar

GetPropertyValues yöntemi sınıfı tarafından ProfileBase tarafından yönetilen SqlProfileProvidergeçerli isteğin profil özelliklerini almak için kullanılır. Özellik değerleri, yapılandırma dosyasında özniteliği tarafından applicationName belirtilen uygulamanın veri kaynağından döndürülür. Özellik değerleri ve ek özellik bilgileri bir nesne koleksiyonu SettingsPropertyValue olarak döndürülür.

Şunlara uygulanır

Ayrıca bkz.