title: SQL Insert statement syntax
body: <p>Basically what I am doing is that upon clicking a button, the program will extract data from a particular row according to what the user chose and place it in a different table by using <code>INSERT</code>. The following is the code.</p>
  
  <pre><code>private void button3_Click(object sender, EventArgs e)
  {
          const String connectionString = "Data Source = Vanessa-PC\\SQLEXPRESS; Initial Catalog = IUMDC; Connect Timeout = 15; Integrated Security = true";
          SqlConnection con = new SqlConnection(connectionString);
  
          //int SituationID1; 
          label24.Show();
  
          foreach (SitID x in Sittbl)
          {
              if (x.ID == Convert.ToInt16(comboBox1.SelectedItem))
              {
                  try
                  {
                      con.Open();
                      SqlCommand command = new SqlCommand("SELECT * FROM Situation WHERE SituationID=" + x.SitIDs, con);
                      SqlDataReader dr = command.ExecuteReader();
  
                      while (dr.Read())
                      {
                          sitid1 = Convert.ToInt32(dr[0]);
                          name1 = dr[4].ToString();
                          incident1 = Convert.ToDateTime(dr[1]);
                          charges1 = dr[5].ToString();
                          nature1 = dr[2].ToString();
                      }
  
                      con.Close();
                  }
                  catch (SqlException ex)
                  {
                      MessageBox.Show("Database failed to connect" + ex.Message);
                  }
  
                  //SituationID = x.SitIDs;
              }
          }
  
          try
          {                       
             con.Open();
             SqlCommand command1 = new SqlCommand("INSERT INTO CurrentSit VALUES (" + sitid1 + ",'" + incident1.ToString("YYYY-mm-DD") + "', '" + nature1 + "', '" + name1 + "', '" + charges1 + "'", con);
             SqlDataReader dr1 = command1.ExecuteReader();
             con.Close();
          }
          catch (SqlException ex)
          {
              MessageBox.Show("Database failed to connect" + ex.Message);
          }
          //Situation Sit = new Situation();
          //Sit.ShowDialog();
      }
  </code></pre>
  
  <p>My code fails and says </p>
  
  <blockquote>
    <p>"Incorrect syntax near <em>row item</em>"</p>
  </blockquote>
  
  <p>The types of the two tables are the same and I have tried to test this thoroughly!</p>