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

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

QueryStringParameter.QueryStringField プロパティ

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

パラメータバインド先のクエリ文字列フィールドの名前を取得または設定します

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

Public Property QueryStringField As
 String
Dim instance As QueryStringParameter
Dim value As String

value = instance.QueryStringField

instance.QueryStringField = value
public string QueryStringField { get;
 set; }
public:
property String^ QueryStringField {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_QueryStringField ()

/** @property */
public void set_QueryStringField (String value)
public function get QueryStringField
 () : String

public function set QueryStringField
 (value : String)

プロパティ
パラメータバインド先のクエリ文字列フィールド識別する文字列

解説解説
使用例使用例

SqlDataSource コントロールQueryStringParameter宣言しListBox コントロールデータ表示する方法次のコード例示しますQueryStringField プロパティには、期待されるクエリ文字列フィールドの名前が設定されパラメータが SelectParameters コレクション追加されています。また、期待される名前/値ペアがクエリ文字列渡されなかった場合考慮しDefaultValue設定してます。

      <asp:ListBox
        id ="ListBox1"
        runat="server"
        DataSourceID="SqlDataSource1"
        DataValueField="EmployeeID"
        DataTextField="LastName" />

<!-- Use a query string that includes empId=1 -->

<!-- Security Note: The SqlDataSource uses a QueryStringParameter,
     Security Note: which does not perform validation of
 input from the client.
     Security Note: To validate the value of
 the QueryStringParameter, handle the Selecting event. -->

      <asp:SqlDataSource
        id="SqlDataSource1"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:MyNorthwind%>"
        SelectCommand="Select EmployeeID, LastName From Employees
 where EmployeeID = @empId">
        <SelectParameters>
          <asp:QueryStringParameter     Name="empId"
 QueryStringField="empId" />
        </SelectParameters>
      </asp:SqlDataSource>
      <asp:ListBox
        id ="ListBox1"
        runat="server"
        DataSourceID="SqlDataSource1"
        DataValueField="EmployeeID"
        DataTextField="LastName" />
    
<!-- Use a query string that includes empId=1 -->
    
<!-- Security Note: The SqlDataSource uses a QueryStringParameter,
     Security Note: which does not perform validation of input from the client.
     Security Note: To validate the value of the QueryStringParameter, handle the
 Selecting event. -->

      <asp:SqlDataSource
        id="SqlDataSource1"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:MyNorthwind %>"
        SelectCommand="Select EmployeeID, LastName From Employees where EmployeeID
 = @empId">
        <SelectParameters>
          <asp:QueryStringParameter Name="empId" QueryStringField="empId"
 />
        </SelectParameters>
      </asp:SqlDataSource>
<asp:ListBox
  id ="ListBox1"
  runat="server"
  DataValueField="EmployeeID"
  DataTextField="LastName" />

<asp:SqlDataSource
  id="SqlDataSource1"
  runat="server"
  ConnectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;"
  SelectCommand="Select EmployeeID, LastName From Employees where EmployeeID
 = @empId">
  <SelectParameters>
    <asp:QueryStringParameter runat="server" Name="empId"
 QueryStringField="empId" />
  </SelectParameters>
</asp:SqlDataSource>

SqlDataSource コントロールQueryStringParameter宣言し、GridView コントロールデータ表示する方法次のコード例示しますQueryStringParameter が、出力パラメータおよび戻り値パラメータとして使用されるその他パラメータ オブジェクトと共に SelectParameters コレクション追加されています。データ取得用のストアド プロシージャから返された値を処理する必要があります。このコード例は、SqlDataSourceStatusEventArgs クラストピック取り上げているコード例一部分です。

<asp:sqldatasource
    id="SqlDataSource1"
    runat="server"
    datasourcemode="DataSet"
    connectionstring="<%$ ConnectionStrings:MyNorthwind%>"
    selectcommand="getordertotal"
    onselected="OnSelectedHandler">
    <selectparameters>
      <asp:querystringparameter name="empId" querystringfield="empId"
 />
      <asp:parameter name="total" type="Int32"
 direction="Output" defaultvalue="0"
 />
      <asp:parameter name="_ret" type="Int32"
 direction="ReturnValue" defaultvalue="0"
 />
    </selectparameters>
</asp:sqldatasource>
<asp:sqldatasource
    id="SqlDataSource1"
    runat="server"
    datasourcemode="DataSet"
    connectionstring="<%$ ConnectionStrings:MyNorthwind%>"
    selectcommand="getordertotal"
    onselected="OnSelectedHandler">
    <selectparameters>
      <asp:querystringparameter name="empId" querystringfield="empId"
 />
      <asp:parameter name="total" type="Int32" direction="Output"
 defaultvalue="0" />
      <asp:parameter name="_ret" type="Int32" direction="ReturnValue"
 defaultvalue="0" />
    </selectparameters>
</asp:sqldatasource>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
QueryStringParameter クラス
QueryStringParameter メンバ
System.Web.UI.WebControls 名前空間


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS