I have a C# DateTime
class and wanted to know how I need to format it in a SQL Server CE query to insert it into the database, I was hoping to have both the date and time inserted in. Currently when I try variations thereof I get invalid format exceptions.
Current format I'm using is: dd/MM/yyyy
, was hoping to do something like dd/MM/yyyy hh:mm:ss
.
The way I'm trying to do the insert is like so:
( ( DateTime )_Value ).ToString( "dd/MM/yyyy hh:mm:ss" )
Obviously hh:mm:ss
isn't working, if that isn't there dd/MM/yyyy
executes successfully in the query.
I've tried a few formats including what I've found on google but none have worked so far...