from time to time I get this error
Net packets out of order: received[0], expected[2]
Here is de sub where the error occurs.
Code: Select all
Private Function GetHostname(ByVal locIp As String) As String
Dim x As Integer = 0
Dim MyConn As New MySqlConnection
Try
MyConn = New MySqlConnection
With MyConn
.Host = pubMySQLServerIP
.Port = 3306
.Password = "pissewit"
.Database = "dbHosts"
.UserId = "root"
.Open()
End With
Catch ex As MySqlException
MsgBox(ex.Code & " " & ex.ErrorCode & " " & ex.Message)
End
End Try
Dim mySelectQuery As String = "SELECT hostname from tblhosts where ip = '" & locIp & "'"
Dim myResult As String = ""
Dim myCommand As New MySqlCommand(mySelectQuery, db)
Dim myReader As MySqlDataReader = myCommand.ExecuteReader()
If myReader.HasRows Then
myResult = myReader.GetString(0).ToString()
End If
' <always call Close when done reading.
myReader.Close()
myCommand.Dispose()
myCommand = Nothing
MyConn.Close()
MyConn = Nothing
Return myResult
End Function
Thanks in advance !