Tuesday, December 30, 2008

Get record count from ObjectDataSource

Use the "Selected" declaration for your ObjectDataSource like so:

Private Sub ObjectDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs) Handles ObjectDataSource1.Selected

End Sub

Now, utilize the following code within that subroutine:
Dim numRows As Integer = (e.ReturnValue).Tables(0).Rows.Count

No comments: