本文整理汇总了VB.NET中System.Web.UI.WebControls.ControlParameter.ControlParameter构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET ControlParameter构造函数的具体用法?VB.NET ControlParameter怎么用?VB.NET ControlParameter使用的例子?那么, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了ControlParameter构造函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Button1_Click
Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' The user has pressed the Submit button, prepare a parameterized
' SQL query to insert the values from the controls.
AccessDataSource1.InsertCommand = _
"INSERT INTO Employees (FirstName,LastName,Address,City,PostalCode,Country,ReportsTo) " & _
" VALUES (?,?,?,?,?,?,? ); "
Dim firstName As New ControlParameter("FirstName", "TextBox1", "Text")
AccessDataSource1.InsertParameters.Add(firstName)
Dim lastName As New ControlParameter("LastName", "TextBox2", "Text")
AccessDataSource1.InsertParameters.Add(lastName)
Dim address As New ControlParameter("Address", "TextBox3", "Text")
AccessDataSource1.InsertParameters.Add(address)
Dim city As New ControlParameter("City", "TextBox4", "Text")
AccessDataSource1.InsertParameters.Add(city)
Dim postalCode As New ControlParameter("PostalCode", "TextBox5", "Text")
AccessDataSource1.InsertParameters.Add(postalCode)
Dim country As New ControlParameter("Country", "TextBox6", "Text")
AccessDataSource1.InsertParameters.Add(country)
Dim supervisor As New ControlParameter("ReportsTo", "DropDownList1", "SelectedValue")
AccessDataSource1.InsertParameters.Add(supervisor)
Try
AccessDataSource1.Insert()
Finally
Button1.Visible = False
Label9.Visible = True
End Try
End Sub
示例2: ControlParameter
Dim country As ControlParameter
country = New ControlParameter("country", TypeCode.String, "ListBox1", "SelectedValue")
Dim report As ControlParameter
report = New ControlParameter("report", TypeCode.Int16, "ListBox2", "SelectedValue")