| Bug #65237 | Connection timeout do not work as expect. | ||
|---|---|---|---|
| Submitted: | 8 May 2012 8:38 | Modified: | 8 May 2012 9:07 |
| Reporter: | Cong Danh Doan | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | Connector / NET | Severity: | S2 (Serious) |
| Version: | 6.5.4 | OS: | Windows (XP) |
| Assigned to: | CPU Architecture: | Any | |
[8 May 2012 9:07]
Cong Danh Doan
Please kindly reject this report. It's my mistake. I've choose wrong Properties. Just add DefaultCommandTimeout = 600. Thanks for your help.

Description: As sample code. I'm using Microsoft Visual Studio 2010 SP1. Connector 6.5.4. MySQL server 5.5 and 5.0 How to repeat: static void Main(string[] args) { try { var builder = new MySqlConnectionStringBuilder { Server = "localhost", Database = "mydb", UserID = "usr", Password = "pwd", CharacterSet = "utf8", ConnectionTimeout = 600 }; var connection = new MySqlConnection(builder.GetConnectionString(true)); var command = new MySqlCommand { Connection = connection, CommandText = "select sleep(500)" }; connection.Open(); var s = (int)command.ExecuteScalar(); Console.WriteLine(s); } catch (Exception ex) { Console.WriteLine("Error:" + ex.Message); } Console.ReadLine(); }