473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Dec 19 '05 #1
2 1959
Have you tried the count function in sql
Example
SELECT COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000;

<BS***@newsgroups.nospam> wrote in message
news:pa***********************@ue.ph...
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

Dec 19 '05 #2
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.SqlDataSourceStatusEvent Args) Handles
SqlDataSource1.Selected
Label1.Text = String.Format("rows count: {0}", e.AffectedRows)
End Sub

--
Daniel TIZON
MCP - MCSD.NET - MCT

<BS***@newsgroups.nospam> a écrit dans le message de news:
pa***********************@ue.ph...
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

Dec 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sandy | last post by:
Hello - I have a button that when clicked displays a dataset in a datagrid. I need code to simply display a label instead of the datagrid if no rows are returned. Is there a simple way to...
2
by: JohnR | last post by:
I have a table in a dataset whose fields are bound to various controls on my form. The records are sorted by primary key so when I use the currencymanager to navigate the data, it all appears...
1
by: SomebodyElse | last post by:
Hi. Apologies if this has been asked here before - I've searched & searched but can't find anything. It's probably my serach parameters, but I'm having trouble even describing it to a search...
1
by: Neil | last post by:
Is it possible to reference the dataset of a sqldatasource from code? I've looked at the properties for the sqldatasource but don't see anything obvious. In particular, I have a bit field in the...
2
by: Dominique | last post by:
Hello, Im want to fix the width of a dashboard. I have a field which has a field (in this dashboard on the left part of my screen) which could be long and make the right side of the screen out...
1
by: tom c | last post by:
I am using Visual Web Developer 2005 Express Edition. I created a SQLDataSource just by draging the control to the form and filling in the blanks in the wizard. In code I need to use the...
0
by: Adam Sandler | last post by:
Hello, Prior to posting I looked at http://groups.google.com/group/ microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ d8d5ae243614085e/d4fd6c4a5aa56f75 ...
1
by: Jason Huang | last post by:
Hi, I would like to know what the DataSet name is and where the DataSet is for a SqlDataSource like this: <asp:SqlDataSource ID="SqlDataSourceA" runat="server" ConnectionString="<%$...
158
by: jty0734 | last post by:
i don't know what input size of string is. so i can't gets inputsize before malloc function. i want determine the size of malloc without get inputsize in advance. how to deal with it?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.