title: Update database column during the reading of rows
body: <p>I need to change a column value in the table of my database every time I read a row. Specifically, after the reading of the row I must set the column SENT=1 (by default, before the reading, the value is 0). </p>
  
  <p>My code is:</p>
  
  <pre><code>var sqlCommand = "SELECT * FROM detector_output WHERE SENT=0";
  var Command = new MySqlCommand(sqlCommand, connection);
  MySqlDataReader reader = Command.ExecuteReader();
  while (reader.Read())
  {
      var ident = reader.GetString(0);
      var SENSOR_TYPE = reader.GetString(1);
      var MSG_NAME = reader.GetString(2);
      var DATA_NAME = reader.GetString(3);
      var VALUE = reader.GetString(4);
      var TIMESTAMP = reader.GetString(5);
  
      var connectionUP = new MySqlConnection(cs);
      connectionUP.Open();
      var sqlCommandUPDATE = "UPDATE detector_output SET SENT=1 WHERE ID=ident";
      var CommandUpdate = new MySqlCommand(sqlCommandUPDATE, connectionUP);
      CommandUpdate.ExecuteReader();        
  </code></pre>
  
  <p>The error that I have encountered is:</p>
  
  <blockquote>
    <p>unknown column 'ident' in where clause ...</p>
  </blockquote>