In the form load event, I connect to the SQL Server database:
Private Sub AddBook_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles My
You need to set the Connection property on the command:
myCommand.Connection = myConnection