Short blog today, below is working C# code I ran today to format and update a date in an Oracle database.
My first attempt using just DateTime.Now resulted in error “ORA-01861: literal does not match format string”.

<code>
commSQL.CommandText = "UPDATE PollingTable " +
" SET DATE_POLLED = '" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "'" + 
" WHERE ... ";
</code>

Filed under: C#