title: Why can't I insert data into local database (SQL Compact Edition) with C#?
body: <p>I am doing a project on Visual Studio. I am using a local database (empty sql server compact edition). I chose Dataset and created my table (Images). It has a primary autoincrement id column, and an nvarchar ImagePath column. I want to insert data in it and here is my code.</p>
  
  <pre><code>SqlCeConnection con = new SqlCeConnection();
  con.ConnectionString = yeniApplicationDatabase.Properties.Settings.Default.DatabaseEdaConnectionString;
  con.Open();
  using (SqlCeCommand com = new SqlCeCommand("INSERT INTO Images (ImagePath) VALUES ('book')", con))
  {
    com.ExecuteNonQuery();
  }
  </code></pre>
  
  <p>I don't know why but this one doesn't give any error, the syntax(SQL) is fine. However, when I check the table data, it is still null. Here is the thing;</p>
  
  <p><strong>In the same run</strong>,<br>
  I execute that code, then
  I execute another one which is select * from images...<br>
  It shows 'book'. But still, the table data is empty, and when I rerun it without inserting, only selecting from Images, it is gone again. I really don't understand what is going on. Why can't I put anything in my database?</p>
  
  <p>I also added con.Close() but it still doesn't work.</p>