CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Retireve number of records for a specific column.

Print topic Send  topic

Author Message
kescott


Posts: 49
Posted: 09/09/2008, 12:08 PM

Thanks always for the help.

I want to retrieve a record count for a grid.

I have a grid set up where it lists employee data. Name, Address, Status

The Status values are New, Active, Terminated.

I used the Retrieve Total Number Records for the Grid and it gives the number of records for all the records. It uses this code:


EmployeesTotalRecords.Text = EmployeesData.RecordCount.ToString();


But, I want to retrieve the number of records for just NEW records.
_________________
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
http://www.nsu.edu
View profile  Send private message
kescott


Posts: 49
Posted: 09/09/2008, 1:22 PM

The Employee table would look like this:

---------------------------------------------
Name | Address | Status |
----------------------------------------------
Bob |123 East St | Active |
Mary |345 West Rd | New |
Julie |23 River Ln |Terminated|
Sam |52 Bank Blvd | New |
---------------------------------------------

When the Grid displays the data for the user, I need it to count the total "New" records and display it in the TotalRecords Label it should look something like this:


---------------------------------------------|
Name | Address | Status |
---------------------------------------------|
Total "NEW" Records: (2) |
----------------------------------------------
Bob |123 East St | Active |
Mary |345 West Rd | New |
Julie |23 River Ln |Terminated|
Sam |52 Bank Blvd | New |
---------------------------------------------
I think I'm almost there with this statement:

EmployeesTotalRecords.Text = Settings.vid_connectionDataAccessObject.ExecuteScalar  
("SELECT count(*) FROM Employees WHERE status = 'Active'");  

_________________
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
http://www.nsu.edu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.