Lost connection to MySQL server during query

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
vbturbo
Posts: 3
Joined: Wed 12 Jul 2006 12:21

Lost connection to MySQL server during query

Post by vbturbo » Tue 29 May 2007 07:47

Hi

I have tried to set the connectiontimeout to 20 sec. but doesn't seem to work.

im using a straight forward select command

Private _con As MySqlConnection

Public Function getDataTable(ByRef strSQL As String) As DataTable
Dim strcon As String = ""
strcon = ConfigurationManager.AppSettings("ConnectionString")
_con = New MySqlConnection(strcon)


Dim da As New MySqlDataAdapter(strSQL, _con)

Dim objDataTable As New DataTable()

_con.Open()

Try
da.Fill(objDataTable)
Catch
_con.ConnectionTimeout = 20
da.Fill(objDataTable)
End Try
_con.Close()
_con.Dispose()

Return objDataTable
End Function


in my database table there are 15- 20 rows and 6 columns!

what can i do?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 29 May 2007 15:56

Try to increase da.SelectCommand.CommandTimeout property.

vbturbo
Posts: 3
Joined: Wed 12 Jul 2006 12:21

Post by vbturbo » Wed 30 May 2007 09:05

what is the default (time in sec.)for this property ?

Jens

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 30 May 2007 10:05

The default value is 30 seconds.

Post Reply