J
jorgeo
Hello,
I'm having an annoying error. I try inserting
any datetime into the database but I always get the same
error. The code is quite simple:
// My ExecuteNonQuery function open the conection and
exucute the
//command.
ExecuteNonQuery(string.Format("insert into Tasks
(IDProject,IDTask,Date) "+
"values ({0},{1},'{2}')",
70,70,DateTime.Now));
The message error I have is :
There is an error in the datepart format.
[,,,Expresion,,,]
I have tried changing the value, converting to string,
converting to smalldatetime, and so on ... but I continue
having the same message.
I'd appreciate any help:
jorge ochoa.
I'm using:
VS 2003
Sql CE 2.0
The talbe task is like this in my database:
IDProject int
IDTask int
Date datetime
I'm having an annoying error. I try inserting
any datetime into the database but I always get the same
error. The code is quite simple:
// My ExecuteNonQuery function open the conection and
exucute the
//command.
ExecuteNonQuery(string.Format("insert into Tasks
(IDProject,IDTask,Date) "+
"values ({0},{1},'{2}')",
70,70,DateTime.Now));
The message error I have is :
There is an error in the datepart format.
[,,,Expresion,,,]
I have tried changing the value, converting to string,
converting to smalldatetime, and so on ... but I continue
having the same message.
I'd appreciate any help:
jorge ochoa.
I'm using:
VS 2003
Sql CE 2.0
The talbe task is like this in my database:
IDProject int
IDTask int
Date datetime