简体   繁体   中英

Getting “Internal .Net Framework Data Provider error 30” error when column has NULL value

I have a simple .NET console program that uses OdbcDataReader to fetch rows from Advantage Local Server. I am using System DSN defined via ODBC Administrator on windows 7. Data Source uses Advantage StreamlineSQL ODBC driver v 10.00.00.03 and following params:

  • Database Path:
  • Table Type: Advantage Available
  • Server Types: Local Server (ALS)

The program works fine until it encounters a row that has a NULL value in the column. I then get an exception:

System.InvalidOperationException was caught   Message=Internal .Net Framework Data Provider error 30.   Source=System.Data   StackTrace:
       at System.Data.ProviderBase.DbBuffer.Validate(Int32 offset, Int32 count)
       at System.Data.ProviderBase.DbBuffer.PtrToStringUni(Int32 offset, Int32 length)
       at System.Data.Odbc.OdbcDataReader.internalGetString(Int32 i)
       at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap)
       at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
       at System.Data.Odbc.OdbcDataReader.IsDBNull(Int32 i)
       at OdbcTest.Program.Main(String[] args) in c:\abcoa\visual studio 2010\Projects\OdbcTest\OdbcTest\Program.cs:line 66   InnerException:

Intellisence in VS2010 also gives following hint: *_COMPlusExceptionCode = -532462766*

I have also turned on ODBC tracing and can see following error in the SQL.LOG:

OdbcTest.vshost b34-11e4    EXIT  SQLSetStmtAttrW  with return
code -1 (SQL_ERROR)
        SQLHSTMT            0x0037C6D8
        SQLINTEGER                1228 <unknown>
        SQLPOINTER          [Unknown attribute 1228]
        SQLINTEGER                  -5 

        DIAG [HY092] [iAnywhere Solutions][Advantage ODBC
Driver]Invalid attribute identifier. (2184) 

OdbcTest.vshost b34-11e4    ENTER SQLGetDiagFieldW 
        SQLSMALLINT                  3 
        SQLHANDLE           0x0037C6D8
        SQLSMALLINT                  1 
        SQLSMALLINT                  4 
        SQLPOINTER         0x05ABE480
        SQLSMALLINT                 12 
        SQLSMALLINT *       0x05ABE548

If anyone can help with this I would very much appreciate it!

After contacting Sybase's Advantage.ODBC newsgroup it was suggested that this may be a bug that was fixed in a new upcoming release. I was also able to get new version of the driver by contacting Sybase at advantage@sybase.com and asking them for 10.0.0.5 version of the ODBC driver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM