本文整理汇总了VB.NET中System.Web.UI.WebControls.ObjectDataSource.SelectCountMethod属性的典型用法代码示例。如果您正苦于以下问题:VB.NET ObjectDataSource.SelectCountMethod属性的具体用法?VB.NET ObjectDataSource.SelectCountMethod怎么用?VB.NET ObjectDataSource.SelectCountMethod使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Web.UI.WebControls.ObjectDataSource
的用法示例。
在下文中一共展示了ObjectDataSource.SelectCountMethod属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1:
Protected Sub rowsToDisplay_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rowsToDisplay.SelectedIndexChanged
GridView1.PageSize = Integer.Parse(rowsToDisplay.SelectedValue)
End Sub
示例2: GetSubsetOfEmployees
Public Class CustomerLogic
Public Function GetSubsetOfEmployees(ByVal startRows As Integer, ByVal maxRows As Integer) As List(Of Customer)
Dim ndc As New NorthwindDataContext()
Dim customerQuery = _
From c In ndc.Customers _
Select c
Return customerQuery.Skip(startRows).Take(maxRows).ToList()
End Function
Public Function GetEmployeeCount() As Integer
Dim cachedCount = HttpRuntime.Cache("TotalEmployeeCount")
If cachedCount IsNot Nothing Then
Return Integer.Parse(cachedCount.ToString())
Else
Dim ndc As New NorthwindDataContext()
Dim totalNumberQuery = _
From c In ndc.Customers _
Select c
Dim employeeCount = totalNumberQuery.Count()
HttpRuntime.Cache.Add("TotalEmployeeCount", employeeCount, Nothing, DateTime.Now.AddMinutes(5), Cache.NoSlidingExpiration, CacheItemPriority.Normal, Nothing)
Return employeeCount
End If
End Function
End Class