title: How to calculate sum if using repeater
body: <pre><code>        SqlConnection con = new SqlConnection(connectionString: ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
          con.Open();
          String cquery = "SELECT cart.ProductID, ProName, Size, Colour, Price  FROM cart, Products WHERE Custid=" + Session[custid] + "AND Products.ProductID = cart.ProductID";
          SqlCommand ccmd = new SqlCommand(cquery, con);
          DataTable dataTable = new DataTable();
  
          CRepeater.DataSource = ccmd.ExecuteReader();
          CRepeater.DataBind();
          con.Close();
          DataRow[] dr = dataTable.Select("SUM(Price)");
          Label3.Text = Convert.ToString(dr[0]); ;
  </code></pre>
  
  <p>I am using a repeater to display data from database and i cant seem to figure out how to get the sum using repeater</p>