Solved

How can I count records in ListView

Posted on 2009-07-07
4
258 Views
Last Modified: 2012-05-07
Is thier any way to count records of the list view
0
Comment
Question by:Yadtrt
  • 2
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24792762
Did you check ListView1.ListItems.Count ?
0
 
LVL 6

Author Comment

by:Yadtrt
ID: 24792769
Sorry I mean Form View
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24792796
There are two ways to have row count:

1st is as you also mensioned that one can use rowcount keyword in the SQL statment.

2nd is that you need to assign your returned data to DataTable/Dataset/Gridview control and then you can get the row count.

Regarding to FormView you can use PageCount property which is at the end same thing like RowCount as FormView Displays only one Row at once.
0
 
LVL 6

Author Closing Comment

by:Yadtrt
ID: 31600526
thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question