I have a vb app which connects to a mysql database using the latest MySQL connector for .net. I just have very simple code which opens and closes the connection. It takes 3 seconds.
Using the same MySQL database, I have a php webpage from the same computer as the .net application, connect in and run multiple queries. However the the multiple queries take .02 seconds, and my vb app using the MySQL connector takes 5 seconds using the same DB and less query!
I don't want to use pooling. Is there a better/faster way, or is it just slow?
Using the same MySQL database, I have a php webpage from the same computer as the .net application, connect in and run multiple queries. However the the multiple queries take .02 seconds, and my vb app using the MySQL connector takes 5 seconds using the same DB and less query!
I don't want to use pooling. Is there a better/faster way, or is it just slow?
Code:
Try
Dim connStr As String = "Database=mydb;" & _
"Network Address=192.168.10.101;" & _
"Port=3306;" & _
"User Id=dbuser;Password=shhh;" & _
"Connection Timeout=20"
Dim connection As New MySqlConnection(connStr)
connection.Open()
connection.Close()
MsgBox("Connection is okay.")
Catch ex As Exception
MsgBox(ex.Message)
End Try