title: how to insert current date/time in Ms Access using c#
body: <p>I have tried almost everything to insert the current date and time in to MS Access  database using c# and nothing seems to work.
  The table structure looks like </p>
  
  <pre><code>ID(Primary Key) Est_ID(Number)  saveName(Text) userName(Text) timestamp(Date/Time)
  </code></pre>
  
  <p>The code looks like </p>
  
  <pre><code>OleDbConnection conn = new OleDbConnection(connectionString);
  conn.Open();
  
  DateTime today = DateTime.Today;
  DateTime time= DateTime.Now;
  string name = Request.Form["saveName"];
  
  string my_querry = "INSERT INTO TABLENAME (userName, Est_id,saveName,timestamp) VALUES(@userName,@Est_id,@saveName,@timestamp)";
  
  OleDbCommand cmd = new OleDbCommand(my_querry, conn);
  
  cmd.Parameters.AddWithValue("@userName", userName);
  cmd.Parameters.AddWithValue("@Est_id", est_index);
  cmd.Parameters.AddWithValue("@saveName", name);
  cmd.Parameters.AddWithValue("@timestamp",time);
  
  cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>I have tried formatting. I added # but nothing seems to work. This is really frustrating since I have spent more than a day now getting this to work. What am I doing wrong? </p>