473,698 Members | 2,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1976
Have you tried the count function in sql
Example
SELECT COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000;

<BS***@newsgrou ps.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.W ebControls.SqlD ataSourceStatus EventArgs) Handles
SqlDataSource1. Selected
Label1.Text = String.Format(" rows count: {0}", e.AffectedRows)
End Sub

--
Daniel TIZON
MCP - MCSD.NET - MCT

<BS***@newsgrou ps.nospam> a écrit dans le message de news:
pa************* **********@ue.p h...
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
1854
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 put this in an If statement or do I have to establish another connection and use Count to be able to determine if no rows are returned?
2
7641
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 sorted. When I add a new row to this table and save it (using dataadapter.update) it appears at the end of the list no matter where it should fall in the sorted list. When I exit and re-enter the form the newly added record is then presented in the...
1
3496
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 engine! I'm sure this is a very simple problem, with straighforward solution. It certainly is in classic asp/ado, but I'm finally learning this .NET business. I like it, but can't get my head around some concepts. Anyway....
1
1624
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 dataset that identifies if the user is permitted to make changes to the record. I have what I term "system defined items" for lookup purposes and these can never be changed even by the administrator. I would normally display a bit field as a...
2
2802
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 the display. I wanted the size of the fiedl QueuedCountLabel fixed and the text inside wrapped up and/or the dashboard itself with a fixed width. I was trying a syntax as below:
1
11560
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 SQLDataSource to load data from several tables into datasets or datatables, work with the data, then insert new rows into tables in the SQL Server database. I can not find any example code showing me how to do this. I don't even see any example...
0
4319
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 http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/abb4bcc39312a388/2de51eba9a0bcfd6 Hello,
1
4662
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="<%$ ConnectionStrings:ServiceConnectionStringA %>" SelectCommand="SELECT TestNo, AcceptDate, status FROM TestForm ORDER BY TestNo">
158
6105
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
8680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.