SqlDataSourceFilteringEventArgs.ParameterValues プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SqlDataSourceFilteringEventArgs.ParameterValues プロパティの意味・解説 

SqlDataSourceFilteringEventArgs.ParameterValues プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

SqlDataSource クラスParameter オブジェクトへのアクセス提供する IOrderedDictionary オブジェクト取得します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public ReadOnly Property
 ParameterValues As IOrderedDictionary
Dim instance As SqlDataSourceFilteringEventArgs
Dim value As IOrderedDictionary

value = instance.ParameterValues
public IOrderedDictionary ParameterValues { get;
 }
public:
property IOrderedDictionary^ ParameterValues {
    IOrderedDictionary^ get ();
}
/** @property */
public IOrderedDictionary get_ParameterValues ()
public function get ParameterValues
 () : IOrderedDictionary

プロパティ
Parameter オブジェクトIOrderedDictionary

解説解説
使用例使用例

Northwind データベースからデータ取得しFilterExpression と FilterParameters を使用してフィルタ処理する方法次のコード例示しますSelect メソッド実行してデータ取得するときは常に、SqlDataSourceFilterExpression適用されます。この例では、FilterExpression に、FilterParameters コレクション格納されているフィルタ パラメータのプレースホルダが格納されています。Filtering イベントで、フィルタ パラメータLabel コントロール表示されます。

<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    Protected Sub SqlDataSource1_Filtering(ByVal
 sender As Object, _
        ByVal e As System.Web.UI.WebControls.SqlDataSourceFilteringEventArgs)
        Label1.Text = e.ParameterValues(0).ToString()
    End Sub
</script>

<HTML>
    <BODY>
        <FORM runat="server">

            <p>Show all employees with the following title:
            <asp:DropDownList
                id="DropDownList1"
                runat="server"
                AutoPostBack="True">
                <asp:ListItem>Sales Representative</asp:ListItem>
                <asp:ListItem>Sales Manager</asp:ListItem>
                <asp:ListItem>Vice President, Sales</asp:ListItem>
            </asp:DropDownList></p>

            <asp:SqlDataSource
                id="SqlDataSource1"
                runat="server"
                ConnectionString="<%$ ConnectionStrings:NorthwindConnection
 %>"
                SelectCommand="SELECT EmployeeID,FirstName,LastName,Title
 FROM Employees"
                FilterExpression="Title='{0}'" OnFiltering="SqlDataSource1_Filtering">
                <FilterParameters>
                    <asp:ControlParameter Name="Title"
 ControlId="DropDownList1" PropertyName="SelectedValue"/>
                </FilterParameters>
            </asp:SqlDataSource>

            <p><asp:GridView
                id="GridView1"
                runat="server"
                DataSourceID="SqlDataSource1"
                AutoGenerateColumns="False">
                <columns>
                    <asp:BoundField Visible="False"
 DataField="EmployeeID" />
                    <asp:BoundField HeaderText="First Name"
 DataField="FirstName" />
                    <asp:BoundField HeaderText="Last Name"
 DataField="LastName" />
                </columns>
            </asp:GridView>
                <asp:Label ID="Label1" runat="server"
 Text="Label"></asp:Label>

        </FORM>
    </BODY>
</HTML>
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    //Protected Sub SqlDataSource1_Filtering(ByVal sender As Object,
 _
    //    ByVal e As System.Web.UI.WebControls.SqlDataSourceFilteringEventArgs)
    //    Label1.Text = e.ParameterValues(0).ToString()
    //End Sub


    protected void SqlDataSource1_Filtering(object
 sender, SqlDataSourceFilteringEventArgs e)
    {
        Label1.Text = e.ParameterValues[0].ToString();
    }
</script>

<HTML>
    <BODY>
        <FORM id="FORM1" runat="server">

            <p>Show all employees with the following title:
            <asp:DropDownList
                id="DropDownList1"
                runat="server"
                AutoPostBack="True">
                <asp:ListItem>Sales Representative</asp:ListItem>
                <asp:ListItem>Sales Manager</asp:ListItem>
                <asp:ListItem>Vice President, Sales</asp:ListItem>
            </asp:DropDownList></p>

            <asp:SqlDataSource
                id="SqlDataSource1"
                runat="server"
                ConnectionString="<%$ ConnectionStrings:NorthwindConnection
 %>"
                SelectCommand="SELECT EmployeeID,FirstName,LastName,Title FROM
 Employees"
                FilterExpression="Title='{0}'" OnFiltering="SqlDataSource1_Filtering">
                <FilterParameters>
                    <asp:ControlParameter Name="Title" ControlId="DropDownList1"
 PropertyName="SelectedValue"/>
                </FilterParameters>
            </asp:SqlDataSource>

            <p><asp:GridView
                id="GridView1"
                runat="server"
                DataSourceID="SqlDataSource1"
                AutoGenerateColumns="False">
                <columns>
                    <asp:BoundField Visible="False" DataField="EmployeeID"
 />
                    <asp:BoundField HeaderText="First Name" DataField="FirstName"
 />
                    <asp:BoundField HeaderText="Last Name" DataField="LastName"
 />
                </columns>
            </asp:GridView>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

        </FORM>
    </BODY>
</HTML>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SqlDataSourceFilteringEventArgs クラス
SqlDataSourceFilteringEventArgs メンバ
System.Web.UI.WebControls 名前空間
SqlDataSource.FilterParameters プロパティ
SqlDataSource.FilterExpression プロパティ
SqlDataSource.Filtering イベント
SqlDataSourceFilteringEventHandler
Cancel


このページでは「.NET Framework クラス ライブラリ リファレンス」からSqlDataSourceFilteringEventArgs.ParameterValues プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSqlDataSourceFilteringEventArgs.ParameterValues プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSqlDataSourceFilteringEventArgs.ParameterValues プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SqlDataSourceFilteringEventArgs.ParameterValues プロパティ」の関連用語

SqlDataSourceFilteringEventArgs.ParameterValues プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SqlDataSourceFilteringEventArgs.ParameterValues プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS