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 );