title: SQL1159 Initialization error with DB2 .Net Data Provider, reason code 8
body: <p>I am trying to run a local code built in .net and after parsing through many errors like reason code 10 and 3. I am stuck at <strong>RC 8</strong></p>
  
  <p>It gives the following error:</p>
  
  <pre><code>System.TypeInitializationException was unhandled by user code
    HResult=-2146233036
    Message=The type initializer for 'IBM.Data.DB2.DB2Connection' threw an exception.
    Source=IBM.Data.DB2
    TypeName=IBM.Data.DB2.DB2Connection
    StackTrace:
         at IBM.Data.DB2.DB2Connection..ctor(String connectionString)
         at MoreM3.DataAccess.Model.DB2DataProvider.CreateConnection(String connectionString) in C:\M3\MOREM3\Trunk\MOREM3\MoreM3.DataAccess\Model\DB2DataProvider.cs:line 11
         at MoreM3.DataAccess.Model.DB2DataProvider.CreateConnection() in C:\M3\MOREM3\Trunk\MOREM3\MoreM3.DataAccess\Model\DB2DataProvider.cs:line 17
         at MoreM3.DataAccess.StatusDB.LoadOpenStatusesForAssociate(Int32 storeNumber, Int32 associateEmployeeID) in C:\M3\MOREM3\Trunk\MOREM3\MoreM3.DataAccess\StatusDB.cs:line 462
         at MoreM3.MyPage.Page_Load(Object sender, EventArgs e) in C:\M3\MOREM3\Trunk\MOREM3\MOREM3\MyPage.aspx.cs:line 53
         at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
         at System.Web.UI.Control.OnLoad(EventArgs e)
         at System.Web.UI.Control.LoadRecursive()
         at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    InnerException: System.InvalidOperationException
         HResult=-2146233079
         Message=SQL1159  Initialization error with DB2 .NET Data Provider, reason code 8, tokens 0, 120, 112
         Source=IBM.Data.DB2
         StackTrace:
              at IBM.Data.DB2.DB2ConnPool.i()
              at IBM.Data.DB2.DB2ConnPool..ctor()
              at IBM.Data.DB2.DB2Connection..cctor()
         InnerException: 
  </code></pre>
  
  <p><strong>Note</strong>: Googling the reason code 8, I found it says structure mismatch between native and managed code.</p>