title: ExecuteNonQuery: Connection property has not been initialized
body: <p>I'm getting the following error</p>
  
  <blockquote>
    <p>ExecuteNonQuery: Connection property has not been initialized. </p>
  </blockquote>
  
  <p>When the following code is run</p>
  
  <pre><code>Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
  
      Using con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Comp-296\Project1\Project1\Game_time.mdb")
  
          Using cmd = New OleDbCommand("UPDATE User-scores SET User_Name = @User_Name Game_Name = @Game_Name Score = @Score, [Time/Date] = @dt")
  
              con.Open()
              cmd.Parameters.Add("@User_Name", OleDbType.VarWChar).Value = txtUser.Text
              cmd.Parameters.Add("@Game_Name", OleDbType.VarWChar).Value = txtGame.Text
              cmd.Parameters.Add("@Score", OleDbType.VarWChar).Value = txtScore.Text
              cmd.Parameters.Add("@dt", OleDbType.Date).Value = Convert.ToDateTime(txtDate.Text)
  
              cmd.ExecuteNonQuery()
  
              MessageBox.Show("Data Update successfully")
          End Using
      End Using
  
  End Sub
  </code></pre>
  
  <p>Did I forget to put something in the parameter?</p>