C
Christoph Hilmes
Hi NG,
i am using vb.Net and ado.Net to save data in a database. Now i´m trying to
update a datetime-field in a sql-server-database. I use an sql-string like
this
UPDATE Table SET gebdat='15.10.1972'
If i do this by using a command-object (ado.net) i get no error message, but
if i try to send this command directly to the database using the query
analyser i get an error message like this
The conversion of a char data type to a datetime data type resulted in
an out-of-range datetime value
Then i tried to use a different format:
UPDATE Table SET gebdat='10-15-1972'
This one works fine with the query analyser but when i use it from within my
program using the command-obejct i get the same error message that i got
from the query analyser using the first statement.
??????
I have also tried '10/15/1972' and '1972-10-15' and '1972/10/15' but i
always get the same result.
What dateformat do i have to use, so both my database and ado.net can deal
with it?
Any help is much appreaciated ... otherwise i have to change my
database-field to a string-field :-(
Christoph
i am using vb.Net and ado.Net to save data in a database. Now i´m trying to
update a datetime-field in a sql-server-database. I use an sql-string like
this
UPDATE Table SET gebdat='15.10.1972'
If i do this by using a command-object (ado.net) i get no error message, but
if i try to send this command directly to the database using the query
analyser i get an error message like this
The conversion of a char data type to a datetime data type resulted in
an out-of-range datetime value
Then i tried to use a different format:
UPDATE Table SET gebdat='10-15-1972'
This one works fine with the query analyser but when i use it from within my
program using the command-obejct i get the same error message that i got
from the query analyser using the first statement.
??????
I have also tried '10/15/1972' and '1972-10-15' and '1972/10/15' but i
always get the same result.
What dateformat do i have to use, so both my database and ado.net can deal
with it?
Any help is much appreaciated ... otherwise i have to change my
database-field to a string-field :-(
Christoph