title: c# alter table name add column
body: <p>Command executed successfully look at here,..</p>
  
  <pre><code>string strConn = "Data Source=USER\\SQLExpress; Initial Catalog=empdata; Integrated Security=true";
          SqlConnection conn = new SqlConnection(strConn);
          conn.Open();
  
          SqlCommand sqlCmd = new SqlCommand("alter table empreg ADD '"+ this.comboBox1.Text +"' varchar(50)", conn);
  
          int res=sqlCmd.ExecuteNonQuery();
          if (res == 1)
          { MessageBox.Show("New column created"); }
          else
          { MessageBox.Show("sorry unable to create"); }
  </code></pre>
  
  <p>But it goes to 2nd part of if "sorry unable to create" result and the thing is that in SQL studio we can see that column created.
  How is it possible ???</p>