I am using Oracle Db and calling a Simple Select Query but Oracle is throwing a weird error message:

A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Unspecified error Oracle error occurred, but error message could not be retrieved from Oracle. Data type is not supported.

This is CDB Class

This is How I am calling:

        CDb conn = new CDb();
        conn.getConnection();
        System.Data.OleDb.OleDbDataReader reader = null;
        String query = "Select * FROM Table";
        reader = conn.find(query);
        while (reader.Read())
        {
            Console.WriteLine("Going...");
        }

On debugging it thorws exception after printing above mentioned error message. What I am doing wrong?

Database schema:

SB_ID                                     NOT NULL NUMBER(11)
SB_TITLE                                           VARCHAR2(200)
SB_ONDATE                                          TIMESTAMP(0)
SB_RCVDDATE_QAMRI                                  VARCHAR2(10)
SB_RCVDDATE_SHAMSI                                 DATE
SB_MODE                                            NUMBER(1)
SB_PREFERENCE                                      NUMBER(1)
SB_STATUS                                          NUMBER(1)
SB_RASEED_ISSUED                                   NUMBER(1)
SB_MUJIB_ID                                        NUMBER(11)
SB_RECVD_BY_ID                                     NUMBER(11)
SB_MUSTAFTI_FULLNAME                               VARCHAR2(100)
SB_MUSTAFTI_ADDRESS                                VARCHAR2(100)
SB_MUSTAFTI_COUNTRY                                NUMBER(3)
SB_MUSTAFTI_CITY                                   VARCHAR2(100)
SB_MUSTAFTI_STATE                                  VARCHAR2(100)
SB_MUSTAFTI_MOBILE                                 VARCHAR2(20)
SB_MUSTAFTI_PHONE                                  VARCHAR2(20)
SB_MUSTAFTI_FAX                                    VARCHAR2(20)
SB_MUSTAFTI_EMAIL                                  VARCHAR2(40)
SB_MUSTAFTI_NIC                                    VARCHAR2(20)
SB_DISTRIBUTION_DATE                               DATE
SB_ISSUEDATE_QAMRI                                 VARCHAR2(10)
SB_ISSUEDATE_SHAMSI                                DATE
有帮助吗?

解决方案

The only potentially troublesome datatype in the posted schema is a TIMESTAMP but according to the docs that is supported by OLE DB 10g. Find out more.

So, either you're not using a modern version of OLE DB, or there is a more obscure problem with your table. A tiresome but foolproof way of debugging this would be to specify some column names in the query and find which one it doesn't like.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top