i have a problem concerning the Devart.Data.MySql.MySqlDependency class. I want to have two dependencies checking the database for changes, but some how i get the error:
Net packets out of order: received[1], expected[7]
I cannot handle this error using MySqlException. When i run one dependency it works fine, but when i use two it fails, and raises the exception.
This is the code i use to run these two SqlDependencies.
public void register(string id) {
try
{
dept = new MySqlDependency();
dept.AddCommandDependency(objcom);
dept.CheckTimeout = 100;
dept.OnChange += Dept_OnChange2;
objcom.Connection.Name = id;
string connection = objcom.Connection.ConnectionString;
MySqlDependency.Start(connection);
} catch(MySqlException err) {//The exception is not being handled here}
}
I create a new instance of the class this is in, and then i call the method. I do this two times, it looks like this:
MySqlConnection objcon = new MySqlConnection(databasekoplingsadresse_devart());
MySqlConnection objcon_ = new MySqlConnection(databasekoplingsadresse_devart());
SqlDependenCyHandler depthandler = new SqlDependenCyHandler(objcon, "select * from messages");
depthandler.register("obj1");
SqlDependenCyHandler depthandler2 = new SqlDependenCyHandler(objcon_, "select * from tasks");
depthandler2.register("obj2");
I would really appreciate help on this matter