title: Create table dynamically with MySQL command in c#
body: <p>I want to create table dynamically and fill it with random numbers, but when execute code, MySQL throw an error about syntax.</p>
  
  <pre><code> for (int i = 0; i &lt; 100; i++)
          {
              //gameSession is int, i tried use Parameters.AddWithValue but still have same problem.
              MySqlCommand dice = new MySqlCommand("INSERT INTO "+gameSession.ToString()+" (Dice1,Dice2) Values (@dice1,@dice2)", myConnection);
  
  
              Random dice1 = new Random();
              dice.Parameters.AddWithValue("@dice1", dice1.Next(1, 7));
              Random dice2 = new Random();
              dice.Parameters.AddWithValue("@dice2", dice2.Next(1, 7));
              if (myConnection.State == ConnectionState.Closed)
              {
                  myConnection.Open();
              }
              dice.ExecuteNonQuery();
          }
  </code></pre>
  
  <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 INSERT INTO '7571877 ...</p>
  </blockquote>