title: Insert, Update, Delete are not applied on SQL Server CE database file for Windows Mobile
body: <p>I am developing a Windows Mobile 6.5 application with C# using Visual Studio 2008, it's connected to a SQL Server CE database. </p>
  
  <p>I used this code to insert rows, the value of each column is related to a textBox string :</p>
  
  <pre><code>namespace GesTPL
  {
      public partial class Form4 : Form
      {
          public Form4()
          {
             InitializeComponent();
          }
  
          public Form RefToForm1 { get; set; }
  
          static String pathDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
          static String pathDB = System.IO.Path.Combine(pathDir, "releve.sdf");
          static String connectionString = string.Format(@"DataSource={0}", pathDB);
          SqlCeConnection connection = new SqlCeConnection(connectionString);
  
          private void Form4_Load(object sender, EventArgs e)
          {
              connection.Open();
          }
  
          private void button_Fermer_Click_1(object sender, EventArgs e)
          {
              this.RefToForm1.Show();
              this.Close();
          }
  
          private void button_OK_Click_1(object sender, EventArgs e)
          {
              if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox5.Text == "")
              {
                  MessageBox.Show("Fill in all the information first!");
              }
              else
              {
                  SqlCeCommand cmd = new SqlCeCommand("INSERT INTO compteur(numeroCompteur, idGeographique, abonne, police) VALUES(@numeroCompteur, @idGeographique, @abonne, @police)", connection);
                  cmd.Connection = connection;
                  cmd.Parameters.AddWithValue("@numeroCompteur", textBox1.Text);
                  cmd.Parameters.AddWithValue("@idGeographique", textBox2.Text);
                  cmd.Parameters.AddWithValue("@abonne", textBox3.Text);
                  cmd.Parameters.AddWithValue("@police", textBox5.Text);
  
                  try
                  {
                      int affectedrows = cmd.ExecuteNonQuery();
  
                      if (affectedrows &gt; 0)
                      {
                          MessageBox.Show("Data added successfully!");
                      }
                      else
                      {
                          MessageBox.Show("Failed to add data!");
                      }
                  }
                  catch (Exception ex)
                  {
                      MessageBox.Show(ex.Message);
                  }
              } 
          }
      }
  }
  </code></pre>
  
  <p>The problem is that the modifications are only applied on the database in the emulator, but not on the database <code>.sdf</code> file I have in my project.</p>