NOTE: If you are use System.Data.DataTable then you can use this solution
decimal total = 0;
for(int i=0;i {
total += Convert.ToDecimal(dt.Rows[i][2]);
}
txtTotal.Text = total.ToString();
In the aspx page define this:
<p><asp:label text="Total Amount : " runat="server" xmlns:asp="#unknown"></asp:label><asp:textbox id="txtTotal" runat="server" enabled="false" xmlns:asp="#unknown"></asp:textbox></p>
Wrap the calculation in Page_Load or the other method to display data.
Hope this will help.