title: How to setup IBM DB2 9.7 to work with Entity Framework 6 and Visual Studio 2015?
body: <p>I'm using Visual Studio 2015 to develop an ASP.NET MVC application on a Windows 7, 64-bit machine and I want to connect to an IBM DB2 9.7 database using Entity Framework 6 (Code-First). </p>
  
  <p><strong>Background</strong></p>
  
  <p>I've found a number of articles online that indicate that the <code>IBM Data Server Driver</code> package and the <code>IBM Visual Studio Add-In</code> are required in order to use DB2 with Entity Framework 6 (although most of the articles appear to be referencing DB2 version 10.5). I have installed the <code>IBM Data Server Driver</code> package 32-bit and 64-bit versions, and the <code>IBM Visual Studio Add-In</code> (only 32-bit appears to be available), but a DB2 provider does not appear when I attempt to create the ADO.NET Entity Framework Code-First connection.</p>
  
  <p><a href="https://i.stack.imgur.com/644k0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/644k0.png" alt="Visual Studio 2015 Entity Framework Data Source"></a></p>
  
  <p><strong>Install Files</strong></p>
  
  <p>I installed the following files in the order listed:</p>
  
  <ol>
  <li><a href="https://www-945.ibm.com/support/fixcentral/swg/selectFixes?source=dbluesearch&amp;product=ibm%2FInformation%20Management%2FIBM%20Data%20Server%20Client%20Packages&amp;release=9.7.*&amp;platform=Windows%2032-bit,%20x86&amp;searchtype=fix&amp;fixids=*dsdriver*FP011&amp;function=fixId&amp;parent=ibm/Information%20Management" rel="nofollow noreferrer">IBM Data Server Driver Package - Windows 32bit</a></li>
  <li><a href="https://www-945.ibm.com/support/fixcentral/swg/selectFixes?source=dbluesearch&amp;product=ibm%2FInformation%20Management%2FIBM%20Data%20Server%20Client%20Packages&amp;release=9.7.*&amp;platform=Windows%2064-bit,%20x86&amp;searchtype=fix&amp;fixids=*dsdriver*FP011&amp;function=fixId&amp;parent=ibm/Information%20Management" rel="nofollow noreferrer">IBM Data Server Driver Package - Windows 64bit</a></li>
  <li><a href="https://www-945.ibm.com/support/fixcentral/swg/selectFixes?source=dbluesearch&amp;product=ibm%2FInformation+Management%2FIBM+Data+Server+Client+Packages&amp;release=9.7.*&amp;platform=Windows&amp;searchtype=fix&amp;fixids=*odbc_cli*FP011&amp;function=fixId&amp;parent=ibm/Information%20Management" rel="nofollow noreferrer">IBM Data Server Driver for ODBC and CLI (32-bit) - Windows 32bit</a></li>
  <li><a href="https://www-945.ibm.com/support/fixcentral/swg/selectFixes?source=dbluesearch&amp;product=ibm%2FInformation+Management%2FIBM+Data+Server+Client+Packages&amp;release=9.7.*&amp;platform=Windows+64-bit,+x86&amp;searchtype=fix&amp;fixids=*odbc_cli*FP011&amp;function=fixId&amp;parent=ibm/Information%20Management" rel="nofollow noreferrer">IBM Data Server Driver for ODBC and CLI (64-bit) - Windows 64bit</a></li>
  <li><a href="https://www-945.ibm.com/support/fixcentral/swg/selectFixes?source=dbluesearch&amp;product=ibm%2FInformation+Management%2FIBM+Data+Server+Client+Packages&amp;release=9.7.*&amp;platform=Windows+32-bit,+x86&amp;searchtype=fix&amp;fixids=*vsai*FP011&amp;function=fixId&amp;parent=ibm/Information%20Management" rel="nofollow noreferrer">IBM Database Add-Ins for Visual Studio - Windows 32bit</a></li>
  </ol>
  
  <p><strong>Process</strong></p>
  
  <p>After installing the IBM Data Server Driver package, I opened the <code>Default DB2 and Database Client Interface Selection Wizard</code> app for my DB2 client install and set the default configuration to the <code>Default IBM database client interface (ODBC/CLI driver and .NET data provider) copy</code>.</p>
  
  <p>Then, I extracted the zip file for the 32-bit and 64-bit versions of the <code>IBM Data Server Driver for ODBC and CLI</code> to the IBM folder in the C:\Program Files\ and C:\Program Files (x86)\ directories. I opened an elevated command prompt, navigated to the bin folder inside the extracted <code>clidriver</code> folders, and ran the following command:</p>
  
  <pre><code>db2cli install -setup
  </code></pre>
  
  <p>Finally, I installed the <code>IBM Visual Studio Add-In</code>. After installing it, I opened a new MVC project in Visual Studio 2015 and installed the Entity Framework 6 provider for DB2 using Nuget. Then I right-clicked on <code>Models</code> and clicked <code>Add | New Item | Data | ADO.NET Entity Data Model | Add</code>. In the subsequent window, I clicked on <code>Code First from database</code>. In the next window, I clicked <code>New Connection</code>. This is where I arrived at the screen shot I provided above.</p>
  
  <p>For reference, I tried a number of different permutations of the above steps without any luck.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>The documentation for IBM Fix Pack 11 indicates that it works with my database version (9.7.09)...is the documentation wrong?</li>
  <li>Am I missing a step that's preventing the provider from appearing in the list?</li>
  <li>Does the IBM Visual Studio Add-In not work with Visual Studio 2015 despite the articles I've found that suggest otherwise?</li>
  <li>Is the fact that I have a DB2 client installed part of the problem? (I don't really want to uninstall it if it isn't)</li>
  </ol>
  
  <p><strong>Reference Articles</strong></p>
  
  <ol>
  <li><a href="https://www.ibm.com/developerworks/community/forums/html/topic?id=3722e479-9aaf-4711-bdf0-de14c14ad210" rel="nofollow noreferrer">Windows 10 and Visual Studio 2015 Support</a></li>
  <li><a href="https://www.ibm.com/developerworks/community/forums/html/topic?id=992874e7-39b4-4b67-aefb-6a0d23b8ee60" rel="nofollow noreferrer">IBM Driver not recognized as supporting Entity Framework 6</a></li>
  <li><a href="https://www.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.swg.im.dbclient.install.doc/doc/t0007315.html" rel="nofollow noreferrer">Installing IBM data server clients and drivers (Windows)</a></li>
  <li><a href="https://www.ibm.com/developerworks/community/blogs/96960515-2ea1-4391-8170-b0515d08e4da/entry/Getting_Started_with_IBM_Entity_Framework_6_Database_First_using_MVC_5_on_Windows_10?lang=en" rel="nofollow noreferrer">Getting Started with IBM Entity Framework 6 Database First using MVC 5 (LUW,IDS,zOS and IBM i Servers) on Windows 10</a></li>
  <li><a href="http://www-01.ibm.com/support/docview.wss?uid=swg21418043" rel="nofollow noreferrer">DB2 ODBC CLI driver Download and Installation information</a></li>
  <li><a href="https://www.ibm.com/developerworks/community/forums/html/topic?id=12ed045b-7b15-403b-8afb-bdb1158a9773" rel="nofollow noreferrer">VS 2015 support announcement</a></li>
  <li><a href="https://stackoverflow.com/questions/36694433/accesses-db2-with-entity-framework-6-on-visual-studio-2015">Accesses DB2 with entity framework 6 on visual studio 2015
  </a></li>
  <li><a href="https://dondeetan.com/2016/11/30/working-with-entity-framework-6-0-on-ibm-informix-v11-10-in-visual-studio-2015/" rel="nofollow noreferrer">Working with Entity Framework 6.0 ON IBM Informix V11.10+ in Visual Studio 2015</a></li>
  <li><a href="https://www.ibm.com/developerworks/community/blogs/96960515-2ea1-4391-8170-b0515d08e4da/entry/Code_Based_Configuration_of_DB2_EF6_Provider_in_modern_EF_Applications?lang=en" rel="nofollow noreferrer">Code-Based Configuration of EF6 Provider for IBM Data Servers (DB2 for i, z/OS, LUW and IDS) in ASP .NET 5 Applications</a></li>
  </ol>
  
  <p>Thanks.</p>