Which is better data type for date time picker format string"dd/MM/yyy hh:mm:ss:tt"

  • Thread starter Thread starter Amr_Aly
  • Start date Start date
A

Amr_Aly

Guest
Hi Everybody,

I have used date time picker with a custom format "dd/MM/yyy hh:mm:ss:tt" and save it in the access database by using this code

With cmd.Parameters
.Add("@DTime", OleDbType.Date).Value = CDate(DateTimePicker1.Text)
End With

And also the same code for updating, this code since one year ago, Every thing is OK in my app. but yesterday an error occurred when updating the table error says"Convert from Date type to string is not valid" ... I checked my code it is OK the error is not regular, But i tended to change my date type to "DBTimeStamp" like this

With cmd.Parameters
.Add("@DTime", OleDbType.DBTimeStamp).Value = CDate(DateTimePicker1.Text)
End With


IS THIS A GOOD IDEA TO AVOID ANY FUTURE ERROR ?

Any suggestions ...... Thanks in advance


Regards From Amr_Aly

Continue reading...
 
Back
Top