title: C#: Value property of DateTimePicker not compatible with Date/Time of MS Access database 2013
body: <p>I am trying to implement a timestamp that would go inside an ms access 2013 table, inside a C# app using the .NET framework and visual studio 2013, to keep a record of who has logged on inside my app, but I get an error that my INSERT INTO statement has a syntax problem, but when I remove the timestamp parameters all together, and stop using the datetimepicker, the app will manage to insert the username and password inside the database with success, so i reckon there is a compatibility problem between the Date/Time field of ms access 2013 and the value of the datetimepicker tool inside visual studio framework. So now, i ask you, what is the best method to get the current correct date and time and insert it into the said database? I have tried setting the field as a short text and setting the now property of datetime .ToString, that does not work either.</p>
  
  <pre><code>private void loginButton_Click(object sender, EventArgs e)
      {
          using (OleDbConnection connect = new OleDbConnection(ConfigurationManager.ConnectionStrings["LibrarieConectare"].ConnectionString))
          {
              OleDbCommand command = connect.CreateCommand();
              OleDbCommand _logins = connect.CreateCommand();
              dateTimePickerBirthAngajat.Value = DateTime.Now;
              command.Parameters.AddWithValue("@user", textBoxAccount.Text);
              command.Parameters.AddWithValue("@pass", textBoxParola.Text);
              _logins.Parameters.AddWithValue("@utilizator", textBoxAccount.Text);
              _logins.Parameters.AddWithValue("@parola", textBoxParola.Text);
              _logins.Parameters.AddWithValue("@datetime", dateTimePickerBirthAngajat.Value);
              command.CommandText = "SELECT IDAngajat FROM Angajati WHERE NumeUtilizator=@user AND Parola=@pass";
              _logins.CommandText = "INSERT INTO Logins (Utilizator, Parola, TimeStamp) VALUES (@utilizator, @parola, @datetime)";
  
              connect.Open();
  
              try
              {
                  using (OleDbDataReader dr = command.ExecuteReader())
                  {
                      if (dr.HasRows)
                      {
                          this.DialogResult = DialogResult.OK;
                          user = textBoxAccount.Text;
                          parola = textBoxParola.Text;
                          if (rememberMe.Checked == true)
                         {
                             _logins.ExecuteNonQuery();
                         }  
                      }
                      else
                      {
                          this.DialogResult = DialogResult.Cancel;
                          MessageBox.Show("Login failed!");
                      }
                  }
              }
              catch (Exception ex)
              {
                  MessageBox.Show("Eroare baza de date: " + ex);
              }
              finally
              {
                  this.Close();
              }
          }
      }
  </code></pre>