title: Web Page Update statement won't update in SQL Server
body: <p>My update statement functions but unfortunately doesn't ACTUALLY update the row in SQL Server. When I check SQL Server, the row is the same as when "profile" was created. Please let me know if any more info is needed besides my update statement.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>// Update statement
  SqlConnection MyConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["F18_kslchaneconnectionstringLOGIN"].ConnectionString);
  
  string updatestatement = "UPDATE dbo.userprof SET firstu = '"+TextBox1+"', lastu='"+TextBox1+ "', emailu='" + TextBox2 + "',phonenum='" + TextBox3 + "',orgname='" + TextBox4 + "',titleuser='" + TextBox5 + "',deptuser='" + TextBox6 + "', password='" + TextBox7 + "');";
  
  SqlCommand mysqlupdate = new SqlCommand(updatestatement, MyConnection);
  
  // cn.Open();
  // string sql = "UPDATE main SET s_name='" + TextBox1.Text + "',inst_code='" + DropDownList1.SelectedItem.Value.ToString() + "',ms_oms='" + Label7.Text + "',elligiblity='" + Label12.Text + "',Board='" + DropDownList5.SelectedItem.Value.ToString() + "',percentage='" + float.Parse(TextBox4.Text) + "',amount='" + Label10.Text + "' WHERE elg_id = " + DropDownList4.SelectedItem.Value + "";
  
  // OleDbCommand cmd = new OleDbCommand(sql, cn);
  // cmd.ExecuteNonQuery();
  // cmd.Dispose();
  // cn.Close();
  
  // mysqlupdate.Parameters.AddWithValue("@firstu", TextBox1.Text);
  // mysqlupdate.Parameters.AddWithValue("@lastu", TextBox1.Text);
  // mysqlupdate.Parameters.AddWithValue("@emailu", TextBox2.Text);
  // mysqlupdate.Parameters.AddWithValue("@phonenum", TextBox3.Text);
  // mysqlupdate.Parameters.AddWithValue("@orgname", TextBox4.Text);
  // mysqlupdate.Parameters.AddWithValue("@titleuser", TextBox5.Text);
  // mysqlupdate.Parameters.AddWithValue("@deptuser", TextBox6.Text);
  // mysqlupdate.Parameters.AddWithValue("@password", TextBox7.Text);
  
  try
  {
      MyConnection.Open();
      // mysqlupdate.ExecuteNonQuery();
      // mysqlupdate.Dispose();
  
      Label1.Text = "User has been updated!";
  }
  catch (Exception myexception)
  {
      Label1.Text = myexception.Message;
      MyConnection.Close();
  }
  </code></pre>