dynamicgl / h2sharp

Automatically exported from code.google.com/p/h2sharp
0 stars 0 forks source link

H2Datareader.GetDateTime(Int32 i) problem #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There is a problem with H2Datareader.GetDateTime(Int32 i) function in 
H2DataReader.cs

1. Create a table with a column of type TIMESTAMP
2. Insert into table any value stored in DateTime variable
(e.g. '15.03.2012 11:45:00')  ...insert OK
3. Read from table via H2DataReader.GetDateTime(Int32 i) into DateTime variable 
throw an exception of type 'org.h2.jdbc.JdbcSQLException' with message: 'Cannot 
parse date constant "1", cause: "format yyyy-mm-dd"'
StackTrace:
in org.h2.jdbc.JdbcResultSet.getDate(Int32 i)
in System.Data.H2.H2DataReader.GetDateTime(Int32 ordinal) 
in H2DataReader.cs:line 135

Version of H2Sharp is 1.1.0.0 (build from sources)

Some solution is cast:
DateTime result=(DateTime)H2Datareader.GetValue(Int32 i) ...its OK

Thanks

Original issue reported on code.google.com by marianma...@gmail.com on 15 Mar 2012 at 12:09