title: trying to update mysql tabl via c#, not getting error but the table is not updated..?
body: <pre><code>string LinkB =$@&quot;server=localhost;userid=root;password=admin;database={Database.Text}&quot;;  
  var conL = new MySqlConnection(LinkB); 
  conL.Open(); 
  var cmd = new MySqlCommand(); 
  cmd.Connection = conL; 
  string PkName = KeyColumn(); 
  foreach (DataGridViewRow row in Grid.Rows) 
  { 
  
      if (Convert.ToBoolean(row.Cells[&quot;EditBox&quot;].Value)) 
      { 
          var valueKey = row.Cells[PkName].Value; 
      
          foreach (DataGridViewCell cell in row.Cells) 
          { 
          
              if (cell.OwningColumn.Name != &quot;EditBox&quot;) 
              { 
              
                  string column = cell.OwningColumn.Name; 
                  string value = Convert.ToString(cell.Value); 
                  /*string query = $&quot; INSERT INTO {Collection.Text} VALUES ({pizzaHot})&quot;;*/ 
                  string query1 = $&quot; UPDATE {Collection.Text} SET {column} = '{value}' WHERE {PkName} = '{valueKey}'&quot;; 
                  cmd.CommandText = query1; 
                  cmd.ExecuteScalar(); 
                  MessageBox.Show(query1); 
              
              } 
          
          } 
      
      } 
  
  }
  </code></pre>