本文整理汇总了VB.NET中System.Web.UI.WebControls.LinqDataSourceSelectEventArgs类的典型用法代码示例。如果您正苦于以下问题:VB.NET LinqDataSourceSelectEventArgs类的具体用法?VB.NET LinqDataSourceSelectEventArgs怎么用?VB.NET LinqDataSourceSelectEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LinqDataSourceSelectEventArgs类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: ExampleDataContext
Protected Sub LinqDataSource_Selecting(sender As Object, e As LinqDataSourceSelectEventArgs)
Dim exampleContext As New ExampleDataContext()
e.Result = From p In exampleContext.Products Where p.Category = "Beverages"
Select New With { _
Key .ID = p.ProductID, _
Key .Name = p.Name _
}
End Sub
示例2: citiesArray
Partial Class Default3
Inherits System.Web.UI.Page
Dim citiesArray() As String = _
{ _
"Atlanta", _
"Charlotte", _
"Denver", _
"New York", _
"San Francisco" _
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub LinqDataSource_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LinqDataSourceSelectEventArgs) Handles LinqDataSource1.Selecting
Dim cities = From city In citiesArray _
Where city > "B" _
Select city
e.Result = cities
' Or we could set e.Result = citiesArray to return all rows.
End Sub
End Class