.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 31st, 2005, 04:33 AM
NinaWilliam NinaWilliam is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: @Home :D
Posts: 50 NinaWilliam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 31 sec
Reputation Power: 0
HOW to count records in database??

in my database each doctor has multiple slips (one to many)..i want to cout the total
number of slips for each doctor and display it in the datagrid...in a culomn called
"Uncompleted Slips".. so it will display the total number of slips near the doctor name

How can i do that??

SQL Server 2000

Reply With Quote
  #2  
Old June 17th, 2005, 06:57 AM
arora arora is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 7 arora User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 41 m
Reputation Power: 0
i think u can use following query for that
select count(slips) from <table name> where doctorname=' specify name '

Quote:
Originally Posted by NinaWilliam
in my database each doctor has multiple slips (one to many)..i want to cout the total
number of slips for each doctor and display it in the datagrid...in a culomn called
"Uncompleted Slips".. so it will display the total number of slips near the doctor name

How can i do that??

SQL Server 2000

Reply With Quote
  #3  
Old June 30th, 2005, 07:42 AM
ngcSofte ngcSofte is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 ngcSofte User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 13 sec
Reputation Power: 0
One way (most efficient? I dunno) to do this is query, like the reply above, load it into a dataset. Then use myDS.count (I think that's it, not sure of specifics, but I know there is an attribute of a dataset called count that tells how many records have been loaded into it.)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > HOW to count records in database??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT