Timeout parameter for MySqlConnection?
Posted by: Gene Holmerud
Date: June 26, 2017 07:32PM

I'm trying a simple DB read using a Vis Basic example from Stack Overflow. My MySQL is slow (OrangePi based). Is there a timeout parameter for the MySqlConnection() and MySqlCommand() methods? My code is (some redacting):

Imports System.Data.SqlClient
Imports MySql.Data
Imports MySql.Data.MySqlClient


Public Class Form1

Private Sub btnQuery_Click(sender As Object, e As EventArgs) Handles btnQuery.Click
Try
Dim connect As New MySqlConnection("server=192.168.*.***; user id=az******rm; password=******; database=SciBwl_Operation;")
connect.Open()

Dim sqladapter As New MySqlDataAdapter
Dim sqlcmd As New MySqlCommand
Dim dr As String
Dim dt As New DataTable

sqlcmd = New MySqlCommand("SELECT RoomA complaint WHERE GlobalRound='RR1'")
dr = sqlcmd.ExecuteScalar()
'dr now contains the value of [COLUMN NAME] for the first returned row.
Console.WriteLine("Maybe")
Console.WriteLine(dr.ToString())
connect.Close()
Catch ex As Exception
Console.WriteLine("The process failed: {0}", ex.ToString())
End Try
End Sub
End Class

Options: ReplyQuote


Subject
Written By
Posted
Timeout parameter for MySqlConnection?
June 26, 2017 07:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.