I just check other posts on stack overflow about the connection timeout, but looks like everybody fixed it using
com.CommandTimeout = int.MaxValue;
and
dbaccess.ServerAddress = "Server=mysql;Database=MyDB;Connect Timeout=2147483;Uid=username;Pwd=mypassword";
Unfortunately, I still get this error message after 40 seconds:
The timeout period elapsed prior to completion of the operation or the server is not responding.
You can take a look at the two screenshots.
MySQL Workbench works fine and it takes 48 seconds in executing the same query.
I can not use limits to reduce the subset acquired because I am centralizing information split in different tables. A stored procedure can not be use since the information is stored in different mysql servers too.
Any feedback will be much appreciated.
Fernando
EDIT:
This is the code. I posted the image to show the execution time, not the error message.
public DataSet ExecuteQuery(string[] Query, TableMap[] TableMappings)
{
//Mysql vars
MySqlConnection con;
MySqlCommand com;
MySqlDataAdapter adapter;
DataSet ds;
con = new MySqlConnection();
con.ConnectionString = _serveraddress;
con.Open();
com = con.CreateCommand();
com.CommandType = System.Data.CommandType.Text;
foreach (string st in Query)
{
com.CommandText = com.CommandText + st;
}
com.CommandTimeout = int.MaxValue;
adapter = new MySqlDataAdapter(com.CommandText, con);
foreach (TableMap tm in TableMappings)
{
adapter.TableMappings.Add(tm.SourceTable, tm.TableSet);
}
ds = new DataSet();
adapter.Fill(ds);
return ds;
}
dbaccesstill opening the connection.int.MaxValueto 5000?dbaccessdoes not exist in your edit.