SqlProfileProvider.GetPropertyValues メソッド

定義

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

パラメーター

sc
SettingsContext

ユーザー プロファイル情報を格納する SettingsContext

properties
SettingsPropertyCollection

取得対象プロパティのプロファイル情報を格納する SettingsPropertyCollection

戻り値

プロファイル プロパティの情報と値を格納する SettingsPropertyValueCollection

次のコード例では、現在のプロファイルで識別されるプロファイルのプロパティと値の一覧を示します。

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

注釈

メソッドは GetPropertyValues 、 によって ProfileBase 管理されている現在の要求のプロファイル プロパティを取得するために、 クラスによって SqlProfileProvider使用されます。 プロパティ値は、構成ファイルの 属性によって指定されたアプリケーションの applicationName データ ソースから返されます。 プロパティ値と追加のプロパティ情報は、オブジェクトの SettingsPropertyValue コレクションとして返されます。

適用対象

こちらもご覧ください