FormParameter コンストラクタ (String, TypeCode, String)
アセンブリ: System.Web (system.web.dll 内)

Dim name As String Dim type As TypeCode Dim formField As String Dim instance As New FormParameter(name, type, formField)

FormParameter コンストラクタを使用して作成された FormParameter オブジェクトは、指定されたパラメータ名、Type、およびパラメータのバインド先のフォーム変数を識別する文字列を使用して初期化されます。Direction プロパティおよび ConvertEmptyStringToNull プロパティだけが既定値で初期化されます。

<%@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"> Private Sub Page_Load(sender As Object, e As EventArgs) ' You can add a FormParameter to the AccessDataSource control's ' SelectParameters collection programmatically. AccessDataSource1.SelectParameters.Clear() ' Security Note: The AccessDataSource uses a FormParameter, ' Security Note: which does not perform validation of input from the client. ' Security Note: To validate the value of the FormParameter, ' Security Note: handle the Selecting event. Dim formParam As New FormParameter("lastname" ,TypeCode.String,"LastNameBox") AccessDataSource1.SelectParameters.Add(formParam) End Sub ' Page_Load </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1"> </asp:gridview> </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"> void Page_Load(Object sender, EventArgs e){ // You can add a FormParameter to the AccessDataSource control's // SelectParameters collection programmatically. AccessDataSource1.SelectParameters.Clear(); // Security Note: The AccessDataSource uses a FormParameter, // Security Note: which does not perform validation of input from the client. // Security Note: To validate the value of the FormParameter, // Security Note: handle the Selecting event. FormParameter formParam = new FormParameter("lastname", TypeCode.String, "LastNameBox"); AccessDataSource1.SelectParameters.Add(formParam); } </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1"> </asp:gridview> </FORM> </BODY> </HTML>
<%@Page Language="VJ#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> void Page_Load(Object sender, System.EventArgs e) { // You can add a FormParameter to the AccessDataSource control's // SelectParameters collection programmatically. AccessDataSource1.get_SelectParameters().Clear(); FormParameter formParam = new FormParameter("lastname", System.TypeCode.String, "LastNameBox"); AccessDataSource1.get_SelectParameters().Add(formParam); } //Page_Load </SCRIPT> <HTML> <BODY> <form id="Form1" runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand = "SELECT OrderID,CustomerID,OrderDate,RequiredDate ,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1"> </asp:gridview> </form> </BODY> </HTML>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


FormParameter コンストラクタ (String, String)
アセンブリ: System.Web (system.web.dll 内)


FormParameter コンストラクタを使用して作成された FormParameter オブジェクトは、指定されたパラメータ名、およびパラメータのバインド先のフォーム変数を識別する文字列を使用して初期化されます。Direction プロパティおよび Type プロパティは、既定値で初期化されます。

<%@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"> Private Sub Page_Load(sender As Object, e As EventArgs) ' You can add a FormParameter to the AccessDataSource control's ' SelectParameters collection programmatically. AccessDataSource1.SelectParameters.Clear() ' Security Note: The AccessDataSource uses a FormParameter, ' Security Note: which does not perform validation of input from the client. ' Security Note: To validate the value of the FormParameter, ' Security Note: handle the Selecting event. Dim formParam As New FormParameter("lastname" ,"LastNameBox") formParam.Type=TypeCode.String AccessDataSource1.SelectParameters.Add(formParam) End Sub ' Page_Load </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1"> </asp:gridview> </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"> void Page_Load(Object sender, EventArgs e){ // You can add a FormParameter to the AccessDataSource control's // SelectParameters collection programmatically. AccessDataSource1.SelectParameters.Clear(); // Security Note: The AccessDataSource uses a FormParameter, // Security Note: which does not perform validation of input from the client. // Security Note: To validate the value of the FormParameter, // Security Note: handle the Selecting event. FormParameter formParam = new FormParameter("lastname" ,"LastNameBox"); formParam.Type=TypeCode.String; AccessDataSource1.SelectParameters.Add(formParam); } </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1"> </asp:gridview> </FORM> </BODY> </HTML>
<%@Page Language="VJ#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> void Page_Load(Object sender, System.EventArgs e) { // You can add a FormParameter to the AccessDataSource control's // SelectParameters collection programmatically. AccessDataSource1.get_SelectParameters().Clear(); FormParameter formParam = new FormParameter("lastname", "LastNameBox"); formParam.set_Type(System.TypeCode.String); AccessDataSource1.get_SelectParameters().Add(formParam); } //Page_Load </SCRIPT> <HTML> <BODY> <form id="Form1" runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1"> </asp:gridview> </form> </BODY> </HTML>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


FormParameter コンストラクタ

名前 | 説明 |
---|---|
FormParameter () | FormParameter クラスの名前のない新しいインスタンスを初期化します。 |
FormParameter (FormParameter) | original パラメータによってインスタンスの値を指定して、FormParameter クラスの新しいインスタンスを初期化します。 |
FormParameter (String, String) | バインド先のフォーム変数フィールドを識別する文字列を指定して、FormParameter クラスの名前付きの新しいインスタンスを初期化します。 |
FormParameter (String, TypeCode, String) | バインド先のフォーム変数を識別する文字列を指定して、FormParameter クラスの厳密に型指定された名前付きの新しいインスタンスを初期化します。 |

FormParameter コンストラクタ (FormParameter)
アセンブリ: System.Web (system.web.dll 内)


FormParameter コンストラクタは、FormParameter インスタンスの複製を作成するための protected コピー コンストラクタです。FormParameter の値 (FormField、Name、Type など) が、すべて新しいインスタンスに転送されます。

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


FormParameter コンストラクタ ()
アセンブリ: System.Web (system.web.dll 内)


FormParameter コンストラクタで作成された FormParameter オブジェクトは、すべてのプロパティに既定値を使用して初期化されます。FormField プロパティは String.Empty に初期化されます。また、Name プロパティは String.Empty に初期化され、Type プロパティは TypeCode.Object に初期化されます。さらに、Direction プロパティは Input に初期化され、DefaultValue プロパティは null (Visual Basic の場合は Nothing) に初期化されます。

<%@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"> Private Sub Page_Load(sender As Object, e As EventArgs) ' You can add a FormParameter to the AccessDataSource control's ' SelectParameters collection programmatically. AccessDataSource1.SelectParameters.Clear() ' Security Note: The AccessDataSource uses a FormParameter, ' Security Note: which does not perform validation of input from the client. ' Security Note: To validate the value of the FormParameter, ' Security Note: handle the Selecting event. Dim formParam As New FormParameter() formParam.Name="lastname" formParam.Type=TypeCode.String formParam.FormField="LastNameBox" AccessDataSource1.SelectParameters.Add(formParam) End Sub ' Page_Load </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1" /> </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"> void Page_Load(Object sender, EventArgs e){ // You can add a FormParameter to the AccessDataSource control's // SelectParameters collection programmatically. AccessDataSource1.SelectParameters.Clear(); // Security Note: The AccessDataSource uses a FormParameter, // Security Note: which does not perform validation of input from the client. // Security Note: To validate the value of the FormParameter, // Security Note: handle the Selecting event. FormParameter formParam = new FormParameter(); formParam.Name="lastname"; formParam.Type=TypeCode.String; formParam.FormField="LastNameBox"; AccessDataSource1.SelectParameters.Add(formParam); } </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:accessdatasource id="AccessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="AccessDataSource1" /> </FORM> </BODY> </HTML>
<%@Page Language="VJ#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> void Page_Load(Object sender, System.EventArgs e) { // You can add a FormParameter to the AccessDataSource control's // SelectParameters collection programmatically. accessDataSource1.get_SelectParameters().Clear(); FormParameter formParam = new FormParameter(); formParam.set_Name("lastname"); formParam.set_Type(System.TypeCode.String); formParam.set_FormField("LastNameBox"); accessDataSource1.get_SelectParameters().Add(formParam); }//Page_Load </SCRIPT> <HTML> <BODY> <form id="Form1" runat="server"> <asp:accessdatasource id="accessDataSource1" runat="server" datasourcemode="DataSet" datafile="Northwind.mdb" selectcommand="SELECT OrderID,CustomerID,OrderDate,RequiredDate,ShippedDate FROM Orders WHERE EmployeeID = (SELECT EmployeeID FROM Employees WHERE LastName = @lastname)"> </asp:accessdatasource> <p>Enter the name "Davolio" or "King" in the text box and click the button. <p> <asp:textbox id="LastNameBox" runat="server" /> <p> <asp:button id="Button1" runat="server" text="Get Records" /> <p> <asp:gridview id="GridView1" runat="server" allowsorting="True" datasourceid="accessDataSource1"> </asp:gridview> </form> </BODY> </HTML>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からFormParameter コンストラクタを検索する場合は、下記のリンクをクリックしてください。

- FormParameter コンストラクタのページへのリンク