本文整理汇总了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
开发者ID:VB.NET开发者,项目名称:System.Web.UI.WebControls,代码行数:37,代码来源:ControlParameter
示例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")
开发者ID:VB.NET开发者,项目名称:System.Web.UI.WebControls,代码行数:5,代码来源:ControlParameter
注:本文中的System.Web.UI.WebControls.ControlParameter.ControlParameter构造函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论