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).
Background
I've found a number of articles online that indicate that the IBM Data Server Driver
package and the IBM Visual Studio Add-In
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 IBM Data Server Driver
package 32-bit and 64-bit versions, and the IBM Visual Studio Add-In
(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.
Install Files
I installed the following files in the order listed:
- IBM Data Server Driver Package - Windows 32bit
- IBM Data Server Driver Package - Windows 64bit
- IBM Data Server Driver for ODBC and CLI (32-bit) - Windows 32bit
- IBM Data Server Driver for ODBC and CLI (64-bit) - Windows 64bit
- IBM Database Add-Ins for Visual Studio - Windows 32bit
Process
After installing the IBM Data Server Driver package, I opened the Default DB2 and Database Client Interface Selection Wizard
app for my DB2 client install and set the default configuration to the Default IBM database client interface (ODBC/CLI driver and .NET data provider) copy
.
Then, I extracted the zip file for the 32-bit and 64-bit versions of the IBM Data Server Driver for ODBC and CLI
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 clidriver
folders, and ran the following command:
db2cli install -setup
Finally, I installed the IBM Visual Studio Add-In
. 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 Models
and clicked Add | New Item | Data | ADO.NET Entity Data Model | Add
. In the subsequent window, I clicked on Code First from database
. In the next window, I clicked New Connection
. This is where I arrived at the screen shot I provided above.
For reference, I tried a number of different permutations of the above steps without any luck.
Questions
- The documentation for IBM Fix Pack 11 indicates that it works with my database version (9.7.09)...is the documentation wrong?
- Am I missing a step that's preventing the provider from appearing in the list?
- Does the IBM Visual Studio Add-In not work with Visual Studio 2015 despite the articles I've found that suggest otherwise?
- 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)
Reference Articles
- Windows 10 and Visual Studio 2015 Support
- IBM Driver not recognized as supporting Entity Framework 6
- Installing IBM data server clients and drivers (Windows)
- Getting Started with IBM Entity Framework 6 Database First using MVC 5 (LUW,IDS,zOS and IBM i Servers) on Windows 10
- DB2 ODBC CLI driver Download and Installation information
- VS 2015 support announcement
- Accesses DB2 with entity framework 6 on visual studio 2015
- Working with Entity Framework 6.0 ON IBM Informix V11.10+ in Visual Studio 2015
- Code-Based Configuration of EF6 Provider for IBM Data Servers (DB2 for i, z/OS, LUW and IDS) in ASP .NET 5 Applications
Thanks.