Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my insert query

SQL
insert into ogs (AppName,ogDate,gger,ogMessage,ogLevel)values ('Test','10-09-2014 AM 06:23:24','TestProject.Program','2014-09-10 11:53:24,214 ERROR [10 ] TestProject.Program -System.Exception: Exception of type System.Exception was thrown. at TestProject.Program.Main(String[] args) in e:\DPL\DPL.Logger\DPL.TestProject\Program.cs:line 24','ERROR')


and this is the table structure

the ogDate field is DateTime type
i have tried this query in data field with many combination with single quotes and without
but its not working its throwing exception as

A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll

Additional information: Data type mismatch in criteria expression.



please help me
Posted
Updated 9-Sep-14 20:38pm
v2

1 solution

Try providing date in YYYY-MM-DD HH:NN:SS format. That is instead of '10-09-2014 AM 06:23:24' use #2014-09-10 06:23:24#
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900