Add the IBM Provider as a Data Source in Visual Studio 2008

Article ID: 64016

The IBM i DB2 .NET Provider is substantially more functional in V6R1 System i Access for Windows, compared with the previous versions. One of the improvements makes the provider available for selection in the Visual Studio Data Source configuration dialogs.

For example, prior to the V6R1 version, you could create a data connection from the Visual Studio Server Explorer by right-clicking the Data Connection item and selecting Add Connection, as shown in Figure 1. However, the Choose Data Source dialog (Figure 2) did not list the IBM i .NET Provider. The only alternative was to select the .NET Framework Data Provider for OLE DB and use one of the IBM i OLE DB Providers.

With the new support, you will see the IBM DB2 for i5/OS provider listed, as shown in Figure 3. Once you select the provider, you are presented with additional dialogs in the Data Source configuration to set provider-specific properties.

If you are using Microsoft Visual Studio 2005 and you install IBM System i Access for Windows V6R1 on your PC, all is well. The next time you start Visual Studio, you'll be able to work with the newly listed provider.

However, if you're using Microsoft Visual Studio 2008, you need to do a little bit more work. The issue is, when you install IBM System i Access for Windows V6R1, some registry settings are added on your PC. The registry settings that are added by the V6R1 install program are for VS2005. To get the new provider support for VS2008, you need to download a small file from IBM that installs the registry settings for VS2008.

Working with the IBMDB2_VS2008.zip file

The file that you need to get is available on the IBM i Software Technical Document site. The document number is 526181697, V6R1 System i Access .NET Provider Not Listed in Microsoft Visual Studio 2008. You can access the document at this URL: http://tinyurl.com/meugx7

Once you get to the IBM document, download the IBMDB2_VS2008.zip file. When you unzip it, you'll see the two .reg files, shown in Figure 4. To update the registry settings, simply double-click each of the .reg files. When you double-click a .reg file, the Registry Editor confirmation message shown in Figure 5 is displayed. Click OK to install the registry settings, after which the message shown in Figure 6 is displayed.

The entire process, from downloading the file to installing the settings, takes only a few minutes.

The next time you start VS2008, you can create a new Data Source. You should now see the IBM DB2 for i5/OS provider as one of the available options, as shown in Figure 3.

Thanks for the post Craig. I had posted the same fix earlier this year on the forums and my personal blog, but it is still great to see an official IBM patch released. One thing not addressed in IBM's registry patch is System i / Visual Studio 2008 development in a 64-bit environment. I have a version of my patch that is working well for me in Vista Enterprise x64. If anyone is interested in my x64 patch, please contact me or grab it from my site: http://www.opendave.com/blog/PostID/10.aspx
I have followed all the setup and the IBM data provider is there just as you specified here, and I am able to set up a connection and get to iSeries data! However, if I perform anything beyond the simplest SQL statement over the smallest table, I get the following error message. I have changed every possibly related setting in the connection string and in my local DSN, but to no avail. Also, it responds with this message virtually immediately everytime. SQL0666 SQL Query exceeds specified time limit or storage limit.
Thanks, Craig! This is by far the most life-changing article I've ever read on systeminetwork. You have no idea how frustrating it was talking to my IBM Partner about not being able to use VS2008 tools against the AS400. I could programatically code, but I couldn't easily link, for example, a gridView control to a DB2 source. When I went to TechEd in May, Microsoft folks were good enough to explain the problem (apparent lack of DDEX files for the provider), but were unable to assist in finding a solution. This article delivered. Thank you, thank you, thank you!

ProVIP Sponsors

ProVIP Sponsors