title: c# mysql wait for previous query to finish
body: <p>This is part of my code in c#</p>
  
  <pre><code>MySqlConnection connection = new MySqlConnection(MyConnectionString);
  connection.Open();
  cmd = connection.CreateCommand();
  ...
  int xxxx;
  cmd.CommandText = "UPDATE myTable SET ..... ";
  xxxx = cmd.ExecuteNonQuery();
  Debug.WriteLine(xxxx + " rows updated");
  
  cmd.CommandText = "select id,... from myTable";
  dr = cmd.ExecuteReader();
  while (dr.Read())
  ...
  </code></pre>
  
  <p>The first query (the update) will take about 30 seconds to execute.
  What i observe, is that maybe the second query is executed before query1 having updated the table.</p>
  
  <ul>
  <li>Is this what is supposed to happen according to this code?</li>
  <li>Is there a way to prevent this from happening (i.e. complete 1st query and then execute 2nd one)</li>
  </ul>