title: how to write mysql create table query in c#
body: <p>how to create table query in c# for mysql database.. </p>
  
  <pre><code>MySqlConnection con = new MySqlConnection("Server=localhost;Database=demo_test;UID=root;Password= ");
  
  MySqlCommand acmd = new MySqlCommand("CREATE TABLE first (" + a.Columns[0] + " int(20) NOT NULL auto_increment,'" + a.Columns[1].ToString() + "' varchar(100) NOT NULL default,PRIMARY KEY (" + a.Columns[0]+") 1", con); 
  con.Open();
  
  acmd.ExecuteNonQuery();
  </code></pre>
  
  <p>it gives me an error</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near ''name' varchar(100) NOT NULL default,PRIMARY KEY (id) 1' at line
    1</p>
  </blockquote>