title: Local Database Insert query does nothing
body: <p>I am trying to insert a row into the database. Below is my query:</p>
  
  <pre><code>using (SqlConnection conn = new SqlConnection("Data Source = (LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Traindata.mdf;Integrated Security=True"))
  {
      string query = "INSERT INTO dbo.Station (Naam, X, Y, Sporen) VALUES (@naam, @x, @y, @sporen)";
  
      using (SqlCommand command = new SqlCommand(query, conn))
      {
          command.Parameters.AddWithValue("@naam", insert[1]);
          command.Parameters.AddWithValue("@x", insert[2]);
          command.Parameters.AddWithValue("@y", insert[3]);
          command.Parameters.AddWithValue("@sporen", insert[4]);
          conn.Open();
          try
          {
              command.ExecuteNonQuery();
          }
          catch (SqlException exc)
          {
              Console.WriteLine("Error to save on database");
              Console.WriteLine(exc.Message);
          }
          conn.Close();
      }
  }
  </code></pre>
  
  <p>When I run it nothing happens (Also no SQL errors).  What am I doing wrong? I am sorry if this is a stupid question, I am merely a beginner. </p>
  
  <p>This should work (I have tested this with a select query that does work).</p>