title: C# SQL Command parameter not working
body: <p>I've done some trouble shooting by taking out the parameters and replacing them with text, and the only parameter that is not working is @seat and I can't figure out why.</p>
  
  <p>allSeats is an array of custom controls. I've tried replacing the parameter contents with an actual string ie. "A1" and that still doesn't work. If I remove the @seat parameter and replace it with A1, it works, but I need to be able to set the column name dynamically.</p>
  
  <pre><code>myConnection.Open();
  
  SqlCommand myCommand = new SqlCommand("UPDATE Events SET @seat = @truefalse WHERE Name = @name", myConnection);
  
  SqlParameter param = new SqlParameter();
  SqlParameter param2 = new SqlParameter();
  SqlParameter param3 = new SqlParameter();
  param.ParameterName = "@seat";
  param2.ParameterName = "@truefalse";
  param2.DbType = System.Data.DbType.Boolean;
  param3.ParameterName = "@name";
  param.Value = allSeats[i].Name;
  param2.Value = allSeats[i].taken;
  param3.Value = name;
  myCommand.Parameters.Add(param);
  myCommand.Parameters.Add(param2);
  myCommand.Parameters.Add(param3);
  myCommand.ExecuteNonQuery();
  </code></pre>
  
  <p>Any help is appreciated. If I need to post more relevant code please let me know and I shall add it.</p>