title: Membership.Updateuser not really updating the database
body: <p>I'm currently working on a membership system for my web application, which is based on forms authentication from the framework.</p>
  
  <p>I created some users with the integrated tool, and the login is perfectly working.  But now what I want to do is to give administrator the capability to create, modify, delete users.</p>
  
  <p>So here is what I've got right now:</p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      Dim muc As MembershipUserCollection = Membership.GetAllUsers()
  
      ComboBox1.DataSource = muc
      ComboBox1.DataValueField = "UserName"
      ComboBox1.DataTextField = "UserName"
      ComboBox1.DataBind()
  End Sub
  
  Protected Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ComboBox1.SelectedIndexChanged
  
      Dim userName As String = ComboBox1.SelectedValue
  
      Dim mu As MembershipUser = Membership.GetUser(userName)
  
      Dim userRoles As String() = Roles.GetRolesForUser(userName)
  
      tbComments.Text = mu.Comment
      tbEmail.Text = mu.Email
      lblUserName.Text = mu.UserName
  End Sub
  
  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
      Dim userName As String = ComboBox1.SelectedValue
      Dim mu As MembershipUser = Membership.GetUser(userName)
  
      If Not mu Is Nothing Then
          Try
              mu.Comment = tbComments.Text
              Membership.UpdateUser(mu)
  
              mu.Email = tbEmail.Text
              Membership.UpdateUser(mu)
  
              mu.IsApproved = True
              Membership.UpdateUser(mu)
  
              mu = Nothing
          Catch ex As Exception
              Console.WriteLine(ex.ToString())
          End Try
      End If
  
      DetailPanel.Visible = False
  End Sub
  </code></pre>
  
  <p>The problem is that the record doesn't seem to be updated in the database.
  I made the multiple calls to <code>Membership.UpdateUser</code> after reading <a href="http://maanehunden.wordpress.com/2009/12/17/things-to-remember-when-using-membership-updateusermembershipuser-user/" rel="nofollow noreferrer">this blog entry</a>, but it didn't change anything.</p>
  
  <p>A strange thing I noticed while debugging, is that when I enter the <code>Button1_Click</code> method, <code>Membership.GetUser(userName)</code> returns me values from my precedent attempt !  I don't really understand what I'm missing.</p>
  
  <p>Does someone have a clue ?</p>
  
  <p>Thanks in advance !</p>