hello,
i would like calculate total point from user the user has 76 point
Am done with total each record so. When i search for user all his point i get total and i want calculate ((total point - 76 Point) = am looking how much left point he has
check the screenshoot
code c#
private void BindGrid()
{
string constr = ConfigurationManager.ConnectionStrings["kankonConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("vacation"))
{
cmd.Parameters.AddWithValue("@Action", "SELECT");
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
GridView1.FooterRow.Cells[11].Text = "الرصيد المستخدك";
GridView1.FooterRow.Cells[12].Text = dt.Compute("Sum(totalva)", "").ToString();
GridView1.FooterRow.Cells[13].Text = "الرصيد المتبقي";
}
}
}
}
}