Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Sql Time out connection (2 replies)

$
0
0
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'")

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>