Sql Time out connection
Posted by: Gabriel Madeira
Date: September 21, 2010 11:44AM

Hi, guys. I would like to know how to fix the error below. Im using VBNet 2008. I installed the connector (last version for windows). In the project, used add reference and choosed MySql.Data.
the code below is to make the connection string:

Imports MySql.Data.MySqlClient

Function ExecutaComando(ByVal query As String) As Integer
Try
Dim rowsEffected As Integer = 0
Dim connection As New MySqlConnection(connStr)
Dim cmd As New MySqlCommand(query, connection)

connection.Open()

rowsEffected = cmd.ExecuteNonQuery()

connection.Close()

Return rowsEffected
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function

Private connStr As String = "Database=IBOV;" & _
"Data Source=localhost;" & _
"User Id=IBOV;"

when I click a button, I run the code below. the problem is that the load in file command takes up to 1 min to load 1 milion records, and then I get an error "time out expired. The timeout period elapsed prior to completion of the operation or the server is not responding"

ExecutaComando("LOAD DATA INFILE 'c:/teste/gerados/saida_load.txt' INTO TABLE eodquotes FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'")

Options: ReplyQuote


Subject
Written By
Posted
Sql Time out connection
September 21, 2010 11:44AM
September 21, 2010 03:25PM
September 21, 2010 06:39PM


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.