Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL Connector for VB 2005 is taking a long time

Status
Not open for further replies.

markhkram

IS-IT--Management
Dec 30, 2008
32
0
0
US
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?

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
 
I figured it out, just a weird problem with my mysql server...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top