title: update 2 different table with just 1 button in asp.net
body: <p>I'm trying to update 2 different table with 1 button in my web application. I'm currently using asp.net to develop my web app. I wonder if it is possible to update 2 different columns from 2 different table. </p>
  
  <p>Here are my backend codes</p>
  
  <pre><code> protected void btnAssign_Click(object sender, EventArgs e)
      {
          //SqlConnection connAdd = new SqlConnection("Data Source = localhost; Initial Catalog = project; Integrated Security= SSPI");
  
          //connAdd.Open();
          //string mySQL;
          //mySQL = "Update LoginRegisterPoliceOfficer Set caseid ='" + lblCID.Text + "' where fullname ='" + DDLpolice.SelectedItem.Text + "'";
          //SqlCommand cmdAdd = new SqlCommand(mySQL, connAdd);
          //cmdAdd.ExecuteNonQuery();
  
          //connAdd.Close();
  
  
  
          SqlConnection connAdd = new SqlConnection("Data Source = localhost; Initial Catalog = project; Integrated Security= SSPI");
  
          connAdd.Open();
          string mySQLL;
          mySQLL = "Update Report Set handle = 'handled' where caseid='"+lblCID.Text+"'";
          SqlCommand cmdAdd = new SqlCommand(mySQLL, connAdd);
          cmdAdd.ExecuteNonQuery();
  
          connAdd.Close();
  
  
      }
  </code></pre>
  
  <p>I'm only able to update 1 but failed to update with the 2nd. Therefore i comment out one of my sql codes.</p>