title: Error: Variable Names must be unique within a query batch or stored procedure
body: <p>I successfully retrieve all my data from my database but whenever i try it for a second time an error occured saying that the variable name @uid has already been declared.. </p>
  
  <p>these are my codes. I dispose my sqlcommandbuilder and close my datareader everytime i used it.. but still no luck in finding the error at my codes.. please help me.. and also whenever i save and update data on my database.. it always succeed on the first try.. but on the second try.. it gets the same error "Variable Names must be unique within a query batch or stored procedure".</p>
  
  <pre><code>    Sub fillDataFields()
      Dim arrImage As Byte()
  
      con.Open()
      comm.CommandText = "Select last_name + ', ' + first_name + ' ' + middle_name as name,course, section, address, " &amp; _
                     "birthday, picture from Users where user_id like @uid"
      comm.Connection = con
      comm.Parameters.AddWithValue("@uid", "" &amp; frmUsers.ListView1.SelectedItems(0).Text &amp; "%")
      dr = comm.ExecuteReader
      While (dr.Read())
          arrImage = dr.Item("picture")
          Dim mstream As New System.IO.MemoryStream(arrImage)
          txtCourse.Text = (dr("course"))
          txtSection.Text = (dr("section"))
          richtxtAddress.Text = (dr("address"))
          txtBirthday.Text = (dr("birthday"))
          txtName.Text = (dr("name"))
          PictureBox1.Image = Image.FromStream(mstream)
      End While
      con.Close()
      dr.Close()
      comm.Dispose()
  End Sub
  </code></pre>