title: error show on There is already an open DataReader associated with this Command which must be closed first
body: <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  
      Dim n As Integer = 0
      str = "select Vote from vote where party='Green'"
      cmd = New SqlCommand(str, con)
      con.Open()
      dr = cmd.ExecuteReader()
      if dr.HasRows Then
        dr.Read()
        n = dr("Vote").ToString()
        n = n + 1
        Label8.Text = n.ToString()
      End If
  
      str = "update Vote set vote='" + n.ToString() + "' where party='Green'"
      cmd = New SqlCommand(str, con)
      cmd.ExecuteNonQuery()
      dr.Read()
      cmd.Dispose()
      con.Close()
  
  End Sub
  </code></pre>