title: Getting "Internal .Net Framework Data Provider error 30" error when column has NULL value
body: <p>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:</p>
  
  <ul>
  <li>Database Path: </li>
  <li>Table Type: Advantage Available</li>
  <li>Server Types: Local Server (ALS)</li>
  </ul>
  
  <p>The program works fine until it encounters a row that has a NULL value in the column.
  I then get an exception:</p>
  
  <pre><code>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:
  </code></pre>
  
  <p>Intellisence in VS2010 also gives following hint:
  *_COMPlusExceptionCode = -532462766*</p>
  
  <p>I have also turned on ODBC tracing and can see following error in the SQL.LOG:</p>
  
  <pre><code>OdbcTest.vshost b34-11e4    EXIT  SQLSetStmtAttrW  with return
  code -1 (SQL_ERROR)
          SQLHSTMT            0x0037C6D8
          SQLINTEGER                1228 &lt;unknown&gt;
          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
  </code></pre>
  
  <p>If anyone can help with this I would very much appreciate it!</p>