0

I have a MS Access '97 OleDB database, with a table named "MyTable"

[Table]
public class MyTable
{
    [Column]
    public DateTime DateStamp;
}

I open it up with a DataContext object, call InsertOnSubmit with a new instance of a MyTable with DateStamp = DateTime.Now. Running SubmitChanges() causes the following exception:

"Data type mismatch in criteria expression."

Should DateStamp be a DBDateType or something?

Thanks!

Ian Ray
  • 378
  • 2
  • 18
  • Possible duplicate of [Trying to insert DateTime.Now into Date/Time field gives "Data type mismatch" error](http://stackoverflow.com/questions/16217464/trying-to-insert-datetime-now-into-date-time-field-gives-data-type-mismatch-er) – Ian Ray Apr 23 '17 at 23:35
  • the first answer from this one solved it for me http://stackoverflow.com/questions/16217464/trying-to-insert-datetime-now-into-date-time-field-gives-data-type-mismatch-er/16218074#16218074 – Ian Ray Apr 23 '17 at 23:35

0 Answers0