SqlProfileProvider.SetPropertyValues Yöntem

Tanım

SQL Server profili veritabanını belirtilen özellik değerleriyle güncelleştirir.

public:
 override void SetPropertyValues(System::Configuration::SettingsContext ^ sc, System::Configuration::SettingsPropertyValueCollection ^ properties);
public override void SetPropertyValues (System.Configuration.SettingsContext sc, System.Configuration.SettingsPropertyValueCollection properties);
override this.SetPropertyValues : System.Configuration.SettingsContext * System.Configuration.SettingsPropertyValueCollection -> unit
Public Overrides Sub SetPropertyValues (sc As SettingsContext, properties As SettingsPropertyValueCollection)

Parametreler

sc
SettingsContext

SettingsContext Kullanıcı profili bilgilerini içeren.

properties
SettingsPropertyValueCollection

SettingsPropertyValueCollection Güncelleştirilecek özellikler için profil bilgilerini ve değerlerini içeren.

Örnekler

Aşağıdaki kod örneği, profil özelliği değerlerini değiştirmek için yöntemini kullanır SetPropertyValues .

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

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

pvalues["ZipCode"].PropertyValue = "98052";
pvalues["CityAndState"].PropertyValue = "Redmond, WA";

p.SetPropertyValues(Profile.Context, pvalues);
Dim p As SqlProfileProvider = _
  CType(Profile.Providers("SqlProvider"), SqlProfileProvider)

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

pvalues("ZipCode").PropertyValue = "98052"
pvalues("CityAndState").PropertyValue = "Redmond, WA"

p.SetPropertyValues(Profile.Context, pvalues)

Açıklamalar

yöntemiSetPropertyValues, geçerli istek için özellik değerleri ayarlandığında SQL Server profil veritabanını güncelleştirmek üzere ASP.NET profil hizmetleri tarafından kullanılır. Özellik değerleri, yapılandırma dosyasında özniteliği tarafından applicationName belirtilen uygulamanın veri kaynağında ayarlanır. tarafından SqlProfileProvider güncelleştirilecek profil özelliği bilgileri ve değerleri bir nesne koleksiyonu SettingsPropertyValue olarak belirtilir.

Şunlara uygulanır

Ayrıca bkz.