Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 loop in sql

Author  Topic 

mahdi87_gh
Yak Posting Veteran

72 Posts

Posted - 2009-08-14 : 10:41:41
hi
suppose there is a table that keeps personnel information(pcode,fname,lname) and there is another that records and keeps the deposits (id,pcode,date,amount).id field is of identity type.
what should i do if i want to display the total amount of money paid by all the people accompanied with their personnel information i.e to have table with fname,lnames,sum fields?
what i am doing now is to first of all fill dataset with the personnel's records and then within a for loop, and through a command gain the total sum.
now please kindly tell how to write the commandtext of dataadapter to fill the dataset the final result table.(fname,lname,sum)

****<< I Love MTN.SH >>****
   

- Advertisement -