Click here to Skip to main content
13,097,754 members (57,368 online)
Rate this:
Please Sign up or sign in to vote.
See more:
    <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 1: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 14-Dec-12 0:53am
thanku its working
__TR__ 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 14-Dec-12 3:51am
sorry i didnt observe that.........
__TR__ 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2017
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