I've created a simple MySQL database with the MySQL connector connecting in my vb .net 2005 project. Everything works & connects great. However, when using the command "show processlist;" in mysql command prompt, I see the open connection from my vb project, even after a "connection.close" and/or "connection.dispose". While accessing the db from my PHP webpage, the connection automatically closes instantly after connecting (which is what I want my VB project to do).
All I want is my program to access the database, close the connection, and never connect to the db again. Anyone know what I'm doing wrong?
All I want is my program to access the database, close the connection, and never connect to the db again. Anyone know what I'm doing wrong?
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