title: SQL update with C# with set @variable
body: <p>I have a problem with SQL query from C#</p>
  
  <pre><code>string sql = @"UPDATE tucitelotazky SET  @otazka = @hodnota;";   
  MySqlCommand cmd = new MySqlCommand(sql, cnn);
  cmd.Parameters.Add("@otazka",otazka);
  cmd.Parameters.Add("@hodnota", hodnota);
  
  cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>Variable <code>@otazka</code> is selected from a combobox and always returns <code>OT1</code>-<code>OT10</code> and it is the name of the column in the database.<br>
  <code>@hodnota</code> contains some text from a textbox.<br>
  If I use this SQL query it reports wrong SQL syntax.</p>