Getting Commands out of sync; You can't run this command now using 2.70.4.0 version
Posted: Wed 13 Apr 2005 16:57
I have the code below which is throwing the following exception using version 2.70.4.0 of the MySQL CoreLab driver. The command worked just fine using an older version.
A first chance exception of type 'CoreLab.MySql.MySqlException' occurred in corelab.mysql.dll
Additional information: Commands out of sync; You can't run this command now
A first chance exception of type 'CoreLab.MySql.MySqlException' occurred in corelab.mysql.dll
Additional information: Commands out of sync; You can't run this command now
Code: Select all
// Create a connection.
MySqlConnection sqlConn = new MySqlConnection( connStr );
// Open the connection.
sqlConn.Open();
// Create the SQL string.
string selectSQL = string.Format( "SELECT {0} FROM traversal WHERE traversal_id = '{1}'", colName, traversalID );
// Create the command.
MySqlCommand sqlCmd = new MySqlCommand( selectSQL, sqlConn );
// Create the reader.
MySqlDataReader sqlReader = sqlCmd.ExecuteReader( System.Data.CommandBehavior.SequentialAccess );