S
Siegfried Heintze
I used Access to define a record with a couple of columns of type TimeStamp.
When using perl, I use the syntax {ts '2004-MAR-15 23:44:22'} to insert a
value using the SQL insert statement. It works great (except for the fact
that I'm using Perl cgi.)
So I now abandon perl in favor of VB.NET on VS.NET and I drag and drop this
table into VS.NET forms designer, create my trusty data adapter, define an
early bound dataset, fill my dataset and bind my datagrid to the dataset and
viola! It works!
Except for one problem: none of the hours, minutes seconds are correct!
Hmmm.... So I tried to fix the problem by changing all the occurances of
DBTime to DBTimeStamp and all the occurances of Date to DateTime. After
fixing a few syntax erros (like changing UpdateTimeCommand to UpdateCommand)
I compile and no syntax errors... ! Great now I run it and single step with
the debugger as I populate my OleDB insert command object with values and
then call ExecuteScalar() and.... it does with an datatype mismatch
exception! Arghh... Foiled again!
I even tried abanding the use of parameterized SQL statements and
concatentated some strings to say
INSERT INTO MYTABLE (DOM) VALUES ({ts '2004-MAR-16 22:44:22'}) and did not
like that either. Why not? It works in Perl!
How can I make VS.NET store hours minutes and seconds along with the date?
Thanks,
Siegfried
When using perl, I use the syntax {ts '2004-MAR-15 23:44:22'} to insert a
value using the SQL insert statement. It works great (except for the fact
that I'm using Perl cgi.)
So I now abandon perl in favor of VB.NET on VS.NET and I drag and drop this
table into VS.NET forms designer, create my trusty data adapter, define an
early bound dataset, fill my dataset and bind my datagrid to the dataset and
viola! It works!
Except for one problem: none of the hours, minutes seconds are correct!
Hmmm.... So I tried to fix the problem by changing all the occurances of
DBTime to DBTimeStamp and all the occurances of Date to DateTime. After
fixing a few syntax erros (like changing UpdateTimeCommand to UpdateCommand)
I compile and no syntax errors... ! Great now I run it and single step with
the debugger as I populate my OleDB insert command object with values and
then call ExecuteScalar() and.... it does with an datatype mismatch
exception! Arghh... Foiled again!
I even tried abanding the use of parameterized SQL statements and
concatentated some strings to say
INSERT INTO MYTABLE (DOM) VALUES ({ts '2004-MAR-16 22:44:22'}) and did not
like that either. Why not? It works in Perl!
How can I make VS.NET store hours minutes and seconds along with the date?
Thanks,
Siegfried