title: MS Access DB doesnt save changes after execution (C#)
body: <p>I have the following code for using an access database</p>
  
  <pre><code> OleDbConnection con = new OleDbConnection(myproject.Properties.Settings.Default.myDBConnectionString);
   con.Open();
   OleDbCommand command = new OleDbCommand("INSERT INTO components (name) VALUES (@p_col1)", con);
   command.Parameters.Add("@p_col1", OleDbType.VarChar).Value = "test row";
   int rows = command.ExecuteNonQuery();
  </code></pre>
  
  <p>At this point rows value is 1 and when I make select queries after that the row inserted is available. The problem comes when the program finishes: in further executions that row isn´t there anymore.</p>
  
  <p>I´ve tried with transactions</p>
  
  <pre><code>OleDbTransaction transaction = con.BeginTransaction();
  command.Transaction = transaction;
  transaction.Commit();
  </code></pre>
  
  <p>and using DataSets and ADO this way</p>
  
  <pre><code>//... add row to dataset ...
  OleDbDataAdapter sda = new OleDbDataAdapter("select * from components", con);
  OleDbCommandBuilder cb = new OleDbCommandBuilder(sda);
  
  sda.Update(ds.Components); //tried with ds.Components.AcceptChanges(); before and after this line
  </code></pre>
  
  <p>but in every case i have the same problem, seems like the insert query is not done in the real database. Do you know why can this be happening???</p>
  
  <p>Thanks in advance</p>