title: Problem with inserting date to Ms-Access database
body: <p>I have in my <code>Ms-Access</code> database table, a date field in Short Date format.</p>
  
  <p>I have in my C# program <code>DateTimePicker</code> control in <code>dd/MM/yyyy</code>  <code>short</code> date format</p>
  
  <p>I try to insert data using C# code like this:</p>
  
  <pre><code>SQL = "insert into MyTbl(D_from,D_to) values (@MyFrom,@MyTo)";
  OleDbCommand Cmd = Conn.CreateCommand();
  OleDbParameter dateparam1 = Cmd.Parameters.AddWithValue("@MyFrom", DbType.DateTime);
  dateparam1.Value = dt_From.Value; 
  
  OleDbParameter dateparam2 = Cmd.Parameters.AddWithValue("@MyTo", DbType.DateTime);
  dateparam2.Value = dt_To.Value;
  
  Cmd.CommandText = SQL;
  Cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>and I got the error: <code>Data type mismatch in criteria expression.</code></p>