SqlCe The format of inserting as date into record
Posted on 2013-11-07
I have a Sqlce database that I insert a row with a date.
Dim insertAssum As String = "INSERT INTO componentDataEntry (modelName, lastModificationDate VALUES('" & localModelName & " , '" & localDateCreated & "')"
Dim assumptionCmd As New SqlCeCommand(insertAssum, connection)
The local Regional date format is "dd/MM/yyyy" and the PC is set to this. when it displays a date it will show this format.
If I try to enter this format into the DB I get an error of "There was an error in part of the date format".
If I enter the date in the format
dim datecreated as string = cdate(localdatecreated).tostring("MM/dd/yyyy hh:mm;ss")
it will work
Although this works, it bugs me that I have to do this