How do you determine the size of the dataset [the record count] delivered by a SqlDataSource?

G

Guest

Hello Everyone,

I am using VB and ASP.Net to build a web application with VS.2005.

I have a SqlDataSource defined and am using it to populate a table [Array].

Is there an easy way to determine the size of the dataset [the record count]
delivered by a SqlDataSource?

Any pointers would be greatly appreciated.

Bob
 
S

Showjumper

Have you tried the count function in sql
Example
SELECT COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000;
 
D

Daniel TIZON

You can subscribe to the folowing event, and read the AffectedRows property

Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles
SqlDataSource1.Selected
Label1.Text = String.Format("rows count: {0}", e.AffectedRows)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top