I am using ASP.NET/VB and I am trying to insert the date and time into the Access Date / Time field, but I am getting an error (data type mismatch in the criteria expression). Here is a simplified version of my code:
Dim myDate As Date = Now() Dim myIns1 As New OleDbCommand("INSERT INTO tableCourse (date_submitted) VALUES (?)", myConn) myIns1.Parameters.AddWithValue("@myDate", myDate) myIns1.ExecuteNonQuery()
Not sure why I get the error, and not quite sure if this is even the right way to get closer to pasting current date. From looking at other similar questions, there seem to be several different ways to do this, but my technical knowledge is limited, so itβs hard for me to understand this (in other words, decipher the answers that use technical terms that I know nothing about).
Thanks in advance!
source share