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
|
|
|
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
|
|
|
|