Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Generate_Script_save() <--- sub that generates the instert into code
'Dim mangosSQL As MySqlConnection
Dim mangosSQL As New MySqlConnection
Dim mangosSQLCommand As New MySqlCommand
mangosSQL.ConnectionString = myConnString
mangosSQLCommand.Connection = mangosSQL
mangosSQLCommand.CommandText = txtScript.Text
Try
mangosSQL.Open()
mangosSQLCommand.ExecuteNonQuery()
Catch MyError As Exception
MsgBox(MyError.Message, MsgBoxStyle.Critical, "Error writing to DB")
Exit Sub
Finally
mangosSQL.Close()
mangosSQL.Dispose()
End Try
End Sub
when ever i run my code i get
The command test property has not been initialized
could any one please give me a reason why this could be happening