Page 1 of 1

Error Fill Datatable

Posted: Tue 21 Sep 2010 07:41
by JayXXX
I'm currently using dotConnect for Oracle 5.70 Express
I got error : "Year, Month, and Day parameters describe an un-representable DateTime."
It occured when filling data into Datatable from OracleDataAdapter which queried table contains a datetime field with Null value.
When I exclude this datetime field in the query, the error didn't appear.
Is it Bug or I have done wrong in my code ?

Posted: Wed 22 Sep 2010 13:14
by Shalex
Please tell us how we should modify this sample to reproduce the error.

Code: Select all

DROP TABLE TIMESTAMPTABLE;
CREATE TABLE TIMESTAMPTABLE (
  COL1 TIMESTAMP(6));
INSERT INTO TIMESTAMPTABLE VALUES (NULL);

Code: Select all

using (OracleConnection conn = new OracleConnection(connStr)) {
    OracleDataAdapter myAdapter = new OracleDataAdapter("SELECT * FROM TIMESTAMPTABLE", conn);
    DataTable table = new DataTable();
    myAdapter.Fill(table);
}