Lost Connection Problem

Lost Connection Problem

Postby Zero-G. » Tue 06 Nov 2007 11:23

Hey

I use your latest product 4.25.20.0 with VB.NET 2005 & SP1
I try to use the following code:
Dim myDataReader As CoreLab.MySql.MySqlDataReader
Dim mySqlCommand As New CoreLab.MySql.MySqlCommand
Dim mysqlconnection As New CoreLab.MySql.MySqlConnection

mysqlconnection.UserId = "*****"
mysqlconnection.Port = "*****"
mysqlconnection.Password = "******"
mysqlconnection.Host = "*****"
mysqlconnection.Database = "*****"
mysqlconnection.ConnectionTimeout = 999999
mysqlconnection.Open()

mySqlCommand.Connection = mysqlconnection
mySqlCommand.CommandText = "Select Kundenstamm.NName, Kundenstamm.VName , " & _
"Count(Auftragbrille.Bewegung) as Brille, Count(Auftraghandelsware.Bewegung)" & _
"as Handelsware, Auftragbrille.AufDat as DatumBrille," & _
"Auftraghandelsware.AufDat as DatumHW from " & _
"Kundenstamm left join Auftraghandelsware On Kundenstamm.KundenID=" & _
"Auftraghandelsware.KundenID left Join Auftragbrille On " & _
"Kundenstamm.KundenID=Auftragbrille.KundenID Where Auftragbrille.Bewegung=0 " & _
"or Auftraghandelsware.bewegung=0 group by Kundenstamm.NName, " & _
"Kundenstamm.VName order by NName, VName"
myDataReader = mySqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
If myDataReader.Read = True Then

I do know, that the execution of this statement uses about 200 seconds. - So, you can see, that I have increased my ConnectionTimeout to more than 200 seconds. - The problem is, that I will get a lost connection error after about 30 seconds...

Hope someone knows some help

THX
Zero-G.
 
Posts: 390
Joined: Sat 09 Dec 2006 12:20

Postby Alexey » Tue 06 Nov 2007 13:16

Try to increase mySqlCommand.CommandTimeout as well.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Zero-G. » Tue 06 Nov 2007 14:03

Hey

That it was!

Thx, works fine now
Zero-G.
 
Posts: 390
Joined: Sat 09 Dec 2006 12:20

Postby Alexey » Tue 06 Nov 2007 14:37

You're welcome :)
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL