compact framework timeou

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Posts: 1
Joined: Sat 05 Nov 2005 04:09

compact framework timeou

Post by npt » Sat 05 Nov 2005 04:18

I'm having a problem with unstable internet access with the MySQLDirect Mobile connector. I understand that if something goes wrong in the MySqlConnection or MySqlCommand classes, an exception is thrown. The problem is that once that exception is thrown, the connection's state stays Open. I need a way to reset it, so I use connection.Close(). Unfortunately this takes forever before it is successfully executed.

Also if I do connection.Open() it takes forever if the internet isn't available. Here is the code in question. It takes a long time both at open and at close, much longer than the 1 second it's supposed to take. Any suggestions?

connection.UserId = user;
connection.Password = pass;
connection.Host = host;
connection.Port = 3306;
connection.Database = database;
connection.ConnectionTimeout = 1;
commander.CommandTimeout = 1;
CoreLab.MySql.MySqlDataReader dataReader = commander.ExecuteReader();

while (dataReader.Read()) {
output.Text = dataReader.GetString(0);

catch(Exception ex ){

output.Text = "Bad Internet" ;



Post by Serious » Tue 08 Nov 2005 09:00

This is restriction of .NET Compact Framework that you cannot use MySqlCommand.CommandTimeout and MySqlConnection.ConnectionTimeout properties. This behavior will be documented.
If you get some exception for reason of internet errors you don't have to close connection. Just create new one.

Post Reply