.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

gridview with letter format

Posted By: Catherine     Posted Date: June 11, 2011    Points:5   Category :C#
Hi I display database data in gridview. And to display the gridview with letter format. before the gridview should display address of the employee then gridview. in that gridview i am displaying name, id and salary. and I would like to display the grand total of the salary. after that the salary grand total should be display in words. How to write this. i am using csharp.

Responses
Author: Gowthammanju             
Posted Date: June 11, 2011     Points: 20   

for displaying grand total

use sql query as

select sum(acamount)as total from table name 


where acamount is the total field name to which u have to sum

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Sasi Prabhu             
Posted Date: June 11, 2011     Points: 20   

try:

Use the Aggrigate Functions

sum(fieldname)

eg.

select count(salary) from tablename

Thanks & Regards,
Sasi Prabhu.
Author: Gowthammanju             
Posted Date: June 11, 2011     Points: 20   

Your question for displaying its not so clear

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Sasi Prabhu             
Posted Date: June 11, 2011     Points: 20   

Hi Catherine,

What u want to display in letter format?


Thanks & Regards,
Sasi Prabhu.
Author: Ravi Ranjan Kumar             
Posted Date: June 11, 2011     Points: 20   

yeah! you need to use Aggregate function to display sum of all values.
Take a Syntax

Select aggregate_function([All|Distinct] Expression) from table_Name 

as
select sum(columnname) from tablename


Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: Ravi Ranjan Kumar             
Posted Date: June 11, 2011     Points: 20   

Hey! if your are looking for convert Numbers to Words format then the given article might be useful for you
http://www.dotnetspider.com/resources/27482-Number-Words.aspx

Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: shiv chandra             
Posted Date: June 14, 2011     Points: 20   

Select SUM(FieldName ) FROM <TableName> 

If you want to select other column along with above query you need to add group by cluase as SUM is aggregate function.

Please Change parameter highlighted in red color with proper FieldName and tablename.

Regards
-------
Shiva


Regards
Shiva


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend