User297437924 posted
Normally, if I want to know the number of rows obtained by a sqldatasource, I use code such as:
Protected Sub SqlDataSourcePublic_Selected(sender As Object, e As SqlDataSourceStatusEventArgs) Handles SqlDataSourcePublic.Selected
If e.AffectedRows > GridViewPublic.PageSize Then
' do something
End If
End Sub
However, suppose that the sql data source has a filter such as:
sqlDataSourcePublic.FilterExpression = _paramfield & " LIKE '{0}%'"
So there might 100 first names, but the filter is set to only those names that start with 'f' (Fred, Frank, Fiona). so there are only 3 records displayed now. How does my code detect the '3'? I could count gridview rows, but the trouble
with that is if I use paging and set a limit of ten rows at a time, and there are twelve rows in total, then the gridview count gives me 10 and not 12.
Thanks.