Command Out Of Sync
Posted: Mon 24 Nov 2008 14:40
I have developed an gps/gprs application on wince os, that use the MyDirect .NET Mobile ver. 4.20.19.1.
I would like to know how i must close the database object
and restore the initial state, in my application, when
"Command out of sync" error occurs.
[CUT]
oCmd = new MySqlCommand();
oCmd.Connection = oMySqlConn;
oCmd.CommandType = CommandType.StoredProcedure;
oCmd.CommandText = "GEvPal";
oCmd.Parameters.Add("iIdNodo", VG.IdNodo);
oCmd.Parameters.Add("iLastID", lastID);
oTab = new MySqlDataTable(oCmd, oMySqlConn);
This command usually works, but if the connection falls or for other reasons generates the error.
I'have tryed to close the connection like this:
....
oMySqlConn.Close();
oMySqlConn = null;
....
and reopens after:
...
MySqlConnection oMySqlConn = new MySqlConnection();
....
but without solving the problem.
For the moment i'm restarting the device for solve the problem.
Thanks, Massimo
I would like to know how i must close the database object
and restore the initial state, in my application, when
"Command out of sync" error occurs.
[CUT]
oCmd = new MySqlCommand();
oCmd.Connection = oMySqlConn;
oCmd.CommandType = CommandType.StoredProcedure;
oCmd.CommandText = "GEvPal";
oCmd.Parameters.Add("iIdNodo", VG.IdNodo);
oCmd.Parameters.Add("iLastID", lastID);
oTab = new MySqlDataTable(oCmd, oMySqlConn);
This command usually works, but if the connection falls or for other reasons generates the error.
I'have tryed to close the connection like this:
....
oMySqlConn.Close();
oMySqlConn = null;
....
and reopens after:
...
MySqlConnection oMySqlConn = new MySqlConnection();
....
but without solving the problem.
For the moment i'm restarting the device for solve the problem.
Thanks, Massimo