0

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

1
Contributor
1
Reply
2
Views
10 Years
Discussion Span
Last Post by eallnepjcc
0

Ok no need to reply, the command text was going to empty text box for somereason was not being filled in by the code like it was saposed to be but i fixed it thank any ways lol. Short post huh

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.