title: How to: Add a result to the same database as login
body: <p>My app shows a menu of a restaurant where, after logging in with an email and password from the database, the client guides you to a computer that calculates Kcal after certain dates. I would like to be able to put the result in the same database and the same data that the client used as the image.
  <a href="https://i.stack.imgur.com/IhwLq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IhwLq.png" alt="This is the calculator"></a>
  [<img src="https://i.stack.imgur.com/UFCN2.png" alt="This is the database for login and where i wanna put the result"></p>
  
  <p>This is for an application I have for a contest</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      ani = Convert.ToInt32(textBox1.Text);
      cm = Convert.ToInt32(textBox2.Text);
      kg = Convert.ToInt32(textBox3.Text);
      s = ani + cm + kg;
      if (s &lt; 250) label_mesaj.Text = "1800";
      else if (s &gt;= 250 &amp;&amp; s &lt;= 275) label_mesaj.Text = "2200";
      else label_mesaj.Text = "2500";
  }
  
  private void button2_Click(object sender, EventArgs e)
  {
      SqlConnection con = new SqlConnection(constr);
      con.Open();
      SqlCommand cmd = new SqlCommand("insert into Clienti(parola,nume,prenume,adresa,email)values('" + textBox4.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox6.Text + "')", con);
      SqlDataAdapter da = new SqlDataAdapter(cmd);
      DataSet ds = new DataSet();
      da.Fill(ds);
  }
  </code></pre>
  
  <p>This is code that add to my database new clients after a registration, so i don't know how to remember that "id_clienti"
  I expect that "label_mesaj" to show on the "kcal_zilnice" in the database after LogIn with the same data.</p>