Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
    <asp:BoundField DataField="OrderNo" HeaderText="OrderNo" />
    <asp:BoundField DataField="Code" HeaderText="Code" />
    <asp:BoundField DataField="Description" HeaderText="Description" />
    <asp:BoundField DataField="Rate" HeaderText="Rate" />
    <asp:TemplateField HeaderText="Qty">
            <asp:Label ID="lblqty" runat="server" Text='<%#Eval("Qty") %>' />
            <asp:Label ID="lbltxttotalprice" runat="server" Text="TotalPrice" />
    <asp:TemplateField HeaderText="Total">
            <asp:Label ID="lbltotal" runat="server" Text='<%# Eval("Total") %>' />
            <asp:TextBox ID="txttotalprice" runat="server" />
    <asp:CommandField ShowEditButton="True" />
Posted 13-Dec-12 2:02am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need not save the sum of total of all records in your database. You can use SUM[^] to query your table and retrieve the total.
SELECT SUM(TotalPrice) AS Total FROM yourTable
dhritirao1221 at 14-Dec-12 0:53am
thanku its working
__TR__ at 14-Dec-12 1:10am
You're welcome.
Just want to let you know that when you rate an answer 1 you are actually downvoting the answer. If you think the answer was helpful you need to rate it a 4 or 5 and not a 1. In other words 1 is for bad answer and 5 is for a good answer.
dhritirao1221 at 14-Dec-12 3:51am
sorry i didnt observe that.........
__TR__ at 14-Dec-12 4:14am
That's ok. This mistake is common with new people visiting this site.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 200
1 PIEBALDconsult 150
2 BillWoodruff 148
3 Jochen Arndt 135
4 DamithSL 130
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190

Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100