title: Check if MySQL UPDATE query was successful or not
body: <p>I have a login system, that will have an option to change a user password if forgotten once they answer their security question correctly.</p>
  
  <p>Everything is working fine, except I'm unsure how to determine if it was successful or not.</p>
  
  <pre><code>If TextBox1.Text = TextBox2.Text Then
              Dim conn As MySqlConnection
              conn = New MySqlConnection("server=localhost; user id=root; password=; database=testing")
              Dim username As Boolean = True
              conn.Open()
              Dim sqlquery As String = "UPDATE user SET password='" &amp; TextBox1.Text &amp; "' WHERE id='" &amp; frmLogin.CurrentUserID &amp; "';"
              Dim data As MySqlDataReader
              Dim adapter As New MySqlDataAdapter
              Dim command As New MySqlCommand
              command.CommandText = sqlquery
              command.Connection = conn
              adapter.SelectCommand = command
              data = command.ExecuteReader
              Dim i As Integer = command.ExecuteNonQuery()
              If (i &gt; 0) Then
                  MessageBox.Show("Success!")
              Else
                  MessageBox.Show("Failed!")
              End If
              data.Close()
              conn.Close()
  
  
          Else
              MsgBox("Passwords must match!")
          End If
  </code></pre>
  
  <p>It should show a message box saying "Success!" if it worked and "Failed!" if not. I'm getting an error --> 'There is already an open DataReader associated with this Connection which must be closed first.'</p>