title: "An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll" visual studio vb.net using database microsoft access
body: <p>im a beginner in vb.net and when i start my coding the error "An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll" i dont know what to do. this is my code.</p>
  
  <pre><code>    Dim cmd As New OleDbCommand("SELECT * FROM [login] WHERE [ID] &amp; [Password] =" &amp; TextBoxUsername.Text &amp; TextBoxPassword.Text &amp; "", myConnection)
  
      myConnection.Open() '*its keep pointing at this* 
  
      Dim dr As OleDbDataReader = cmd.ExecuteReader
      Dim userFound As Boolean
      Dim userID As String = ""
      Dim UserPassword As String = ""
      While dr.Read
          userFound = True
          userID = dr("ID").ToString
          UserPassword = dr("Password").ToString
          Form2.Show()
          Me.Hide()
      End While
      If userFound = False Then
          MessageBox.Show("Invalid Username/Password")
          'Button","User Validation", MessageBoxButton.OK , MessageBoxIcon.Error)'
      End If
      myConnection.Close()
  End Sub
  </code></pre>
  
  <p>End Class**</p>