title: Add column to sql table with c#
body: <p>Hello I got a big problem I am trying to add a new column to my MSSQL Database Table and i tried it like thousand times but it wont work.
  My destination is to press a button then use the function "eventsspalte_Hinzufügen" to add a new column with the name thats Inserted by the user.</p>
  
  <p>This is the snippet. </p>
  
  <pre><code>private void eventsspalte_Hinzufügen()
  {
  
      SQL_eingabe = "ALTER TABLE Teilnahmen_Events ADD @tbName bit NOT NULL ;"; //  CONSTRAINT strconst3 DEFAULT 0
  
      con.Open();
      SqlCommand cmd = con.CreateCommand();
      cmd.CommandType = CommandType.Text;
      cmd.CommandText = SQL_eingabe;
      cmd.Parameters.AddWithValue("@tbName", tb_Eventname.Text);
      cmd.ExecuteNonQuery();
      con.Close();
  }
  </code></pre>
  
  <p>The Exception says that <code>cmd.ExecuteQuery()</code> is not able to Execute the sql Command because of the wromg Syntax at @tbName I also tried to use a variable like: </p>
  
  <pre><code>ALTER TABLE Teilnahmen_Events ADD'"+ tb_Eventname.Text +"'bit NOT NULL ;";
  </code></pre>
  
  <p>but it also didnt work... 
  I hope you got an solution for me thank you very much.</p>