vb.net - Additional information: Data type mismatch in criteria expression saving to database -
I would like to save date from date / time picker in my table where DTPJb = 1.
I am using VB2010 and Microsoft Access 2003. My table contains the following:
Table name: DTP field ID: Auto number DTPJB: Number DTPDT: Date / time with DD / MM / Yyyy hh: nn I use the following coding: -
Due conn ("provider = Microsoft.Jet.Oledb.4.0; data source =" & new as the newbornbandconnection) Application.start startup and amp; \ DB1.mdb ") with new OLED Commands CMD in the form of dim CMD. = CommandType Text = Connection = conn.CommentText = "Update [DTP] Set DTPDT = @ P1 where DTPJBad = @ P2" parameter.Advate Value ("@ P1", MEE DTP.value). Advant value ("@ P2", 1) conn.Open () cmd.ExecuteNonQuery () with the end, however, I get the following error: -
Additional information criteria: the data type mismatch in the expression of the criteria
Any ideas where I went wrong?
Your date is in wrong format, so this is the wrong data type
Try
. Parameter. Advait Value ("@ P1", m.dtp.Value.ToString ("dd / mm / yyyy hh: mm"))
Comments
Post a Comment