I have vb.net desktop app that uses mysql. I can connect remotely without any problem. I have timer control that query the database every 10 secs. Now I want to execute multiple Functions without using multiple connections.
Private Sub Timer__Tick()...
call GET_QUEUED_EMAILS
call Function2
Call Function3
End sub
sample function:
Public Function GET_QUEUED_EMAILS(ByVal sql As String)
Try
' Load From DB
GlobalFunctions.db_connect()
Dim reader As New MySqlDataReader
Dim command As MySqlCommand = connection.CreateCommand()
command.CommandText = sql
reader = command.ExecuteReader
If (reader.HasRows) Then
While (reader.Read())
message_id = reader(0).ToString
message_status = reader(2).ToString
Exit While
End While
reader.Close()
GlobalFunctions.connection.Close()
call another function here....
Else
reader.Close()
GlobalFunctions.connection.Close()
End If
End If
Catch ex As Exception
MessageBox.Show("Error" & ex.Message)
End Try
End Sub'