title: How to update a gridview after saving data?
body: <p>I have one grid view with 4 columns(UserId,Description,Password,Change Password[Button]). </p>
  
  <p>When i click on change password the panel with 3 textboxes(UserID,New Password,Confirm Password) and save button appears. </p>
  
  <p>After changing password the panel disappears but the password in the gridview remains same as previous. </p>
  
  <p>I want to update the password column.</p>
  
  <p>Following is my Save Button Click<br>
  Code                                                                          </p>
  
  <pre><code>protected void BindGridView()
  {
      try
      {
          DataTable dt = new DataTable();
          dt = (DataTable)Session["userinfo"];
  
          gvPassInfo.DataSource = dt;
          gvPassInfo.DataBind();
      }
      catch (Exception ex)
      {
          //lblMessage.Text = DataObjects.Error_Message();
      }  
   }
   protected void btnSave_Click(object sender, EventArgs e)
   {
      clsUser objuser = new clsUser();
      string user = txtUserid.Text;
      string NewPassword = txtNewPassword.Text;
      string ConfirmPassword = txtConfirmNewPassword.Text;
      objuser.UpdateSystemPassword(user, NewPassword);
      Response.Write("&lt;script LANGUAGE='JavaScript' &gt;alert('Password Changed   Successfully...'); document.location='" +ResolveClientUrl("~\\PasswordInformation_Details.aspx") + "'; &lt;/script&gt;");
      BindGridView();
      panelChangePassword.Visible = false;
  
     }                                                                                     
  protected void btnSearch1_Click(object sender, EventArgs e)
  {
      try
      {
          using (MySqlConnection conn = new MySqlConnection(clsUser.connStr))
          {
              conn.Open();
              string strQuery = "select DISTINCT user_id,description,sap_system_password from sap_password_info where user_id is not null";
              if (txtSid.Text !="")
              {
                  strQuery += " AND sid = '" + txtSid.Text + "'";
              }
              if (txtClient.Text != "")
              {
                  strQuery += " AND client_no = '" + txtClient.Text + "'";
              }
              if (txtUser.Text != "")
              {
                  strQuery += " AND user_id = '" + txtUser.Text + "'";
              }
  
              MySqlCommand cmd = new MySqlCommand(strQuery, conn);
              DataTable dt = new DataTable();
              dt.Load(cmd.ExecuteReader(CommandBehavior.CloseConnection));
              Session["userinfo"] = dt;
              Response.Redirect("~\\PasswordInformation_Details.aspx");
          }
      }
      catch (Exception ex)
      {
          //lblMessage.Text = DataObjects.Error_Message();
          lblMsg.Text = ex.Message.ToString();
      }
  
  }
  </code></pre>
  
  <p>The code is in C# and back end is MySQL DB Server.. please help..</p>