Connection error to mysql DB from pocket
Posted: Thu 14 May 2009 19:35
Hi
I need help, i am developing a project, i try to insert values into a mysql database but when i execute the instruction i get an error
Dim cn As New MySqlConnection()
Dim myCommand As New MySql.Data.MySqlClient.MySqlCommand
cn.ConnectionString = "Server=0.0.0.0;Port=3306;Database=test;Uid=x;Pwd=x"
cn.Open()
Try
myCommand.CommandText = "INSERT INTO rechazos values ('Prueba Lulu 4')"
myCommand.ExecuteNonQuery()
Catch ed As Exception
MsgBox(ed.Message, MsgBoxStyle.Critical, "Error de conexion")
Finally
cn.Close()
End Try
And the error is
"Connection must be valid and open"
Is misssing me something ???
Thanks
I need help, i am developing a project, i try to insert values into a mysql database but when i execute the instruction i get an error
Dim cn As New MySqlConnection()
Dim myCommand As New MySql.Data.MySqlClient.MySqlCommand
cn.ConnectionString = "Server=0.0.0.0;Port=3306;Database=test;Uid=x;Pwd=x"
cn.Open()
Try
myCommand.CommandText = "INSERT INTO rechazos values ('Prueba Lulu 4')"
myCommand.ExecuteNonQuery()
Catch ed As Exception
MsgBox(ed.Message, MsgBoxStyle.Critical, "Error de conexion")
Finally
cn.Close()
End Try
And the error is
"Connection must be valid and open"
Is misssing me something ???
Thanks