DBA > Articles

DB2 and Visual Studio 2008: Getting Started

By: Paul Zikopoulos
To read more DBA articles, visit http://dba.fyicenter.com/article/

In a previous set of articles, I showed you all the great integration features between the IBM DB2 9 for Linux, UNIX, and Windows (DB2 9) data server and Microsoft Visual Studio 2005. In another series, I showed you the integration between DB2 and Visual Studio 2003. Quite simply, DB2 has been providing – in my opinion – the richest and most complete database integration for .NET developers, often setting the standard for other database vendors and defining database development productivity.

With DB2 9.5 Fix Pack (or the generally available version of DB2 9.5 with the latest IBM Database Add-ins for Visual Studio) DB2 now supports Visual Studio 2008 which became generally available earlier this year .

In this article, I want to get you started on the path to DB2 and Visual Studio 2008 for .NET developers; additionally, I’ll give you some hints and tips to get you in the express lane when it comes to enabling .NET developers to build DB2 data-bound applications. Things to do in order to get started with Visual Studio 2008 and DB2

Before you get started using Visual Studio 2008 to build your .NET DB2 applications, you need to have the right client connectivity software to connect to the target data server and the component (referred to as an add-in) that provides the rich integration for your DB2 server.

As of DB2 9.5, if you want to connect your .NET application to a DB2 for Linux, UNIX, or Windows data server, you need to a minimum deploy the new IBM Data Server Driver for ODBC, CLI, and .NET. This new driver takes up a mere 10 MB and affords you the opportunity to use the smallest footprint possible for .NET connectivity. This driver supports the .NET 2.0, 3.0, and 3.5 frameworks, just like Visual Studio 2008. Before DB2 9.5, you had to install the DB2 Runtime Client (about 120 MB) to enable this connectivity. You can download the IBM Data Server Driver for ODBC, CLI, and .NET at:


Once you’re able to connect to a DB2 server using .NET, you need to install the IBM Database Add-Ins for Visual Studio to get the rich integration provided between DB2 and Visual Studio 2008. As of DB2 9.5, this add-in is used for any IBM data server connections; whether you’re building a .NET application that runs on DB2 for Linux, UNIX, or Windows, DB2 for z/OS, DB2 for IBM i (formerly known as DB2 for i5/OS), or IBM Informix Dynamic Server (IBM IDS), you use the same add-in. This makes deployment for heterogeneous environments more streamlined because the IBM Database Add-Ins for Visual Studio is a mere 30 MB. In DB2 9, this add-in used to be called the IBM DB2 Add-In for Visual Studio 2005. As you can see, its name has since changed (the version information has been removed, as well as the DB2 moniker) to reflect the fact that the same add-in can now be used in not only the Visual Studio 2005 or Visual Studio 2008 integrated development environments (IDEs) but also for any IBM data server.

The only way to get this add-in in DB2 9 was to install a Windows-based DB2 Client or a server image; this meant a significant footprint (over 150 MB). Quite simply, DB2 9.5 gives you the opportunity to move the footprint required for .NET development from over 250 MB to a mere 40 MB by installing the IBM Data Server Driver for ODBC, CLI, and .NET and the IBM Database Server Add-Ins for Visual Studio. Keep in mind that if you wanted to connect this development environment to DB2 for z/OS or DB2 for i, you would need to add a DB2 Connect license into the connection flow (either directly or through a DB2 Connect gateway); however, this won’t affect the size of the footprint required for connectivity. You can download the IBM Database Add-Ins for Visual Studio at: https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=swg-vsai&S_PKG=dl&lang=en_US&cp=UTF-8.

Note: As of DB2 9, a DB2 data server release with a full version number (or a .5 version number) generally contains new functionality or significant upgrades (for example, DB2 9.5). In contrast, the client connectivity portion of DB2 (clients or drivers) is updated more frequently. Since they are not tied to the data server release schedule, maintenance upgrades (also called fix packs) are just as likely as new versions and point releases to contain new connectivity functionality. Our development laboratories work very hard to ensure backward compatibility. This allows you to gain the benefits of newer client-side functionality in a more dynamic nature. For example, Visual Studio 2008 support is part of the IBM Database Add-Ins for Visual Studio as of DB2 9.5 Fix Pack 1. IBM was able to deliver this timely support for Visual Studio 2008 because of this new client delivery architecture.

When you use this lightweight deployment option to configure your developer’s desktop, you should keep in mind that the IBM Database Add-Ins for Visual Studio and the IBM Data Server Driver for ODBC, CLI, and .NET must be at the same code level. For example, if you plan to support the Visual Studio 2008 IDE, you must install these components at the Fix Pack 1 level. If Fix Pack 2 were to bring other functional changes to either of these components, and you wanted to leverage them, you would have to ensure that both components were at Fix Pack 2.

For anything related to .NET development, this Web site is an all-inclusive starting point for pretty much anything you need to get started: www.ibm.com/software/data/db2/windows/dotnet.html. If you want a free copy of DB2 to get started with .NET development, you can find it at: www.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-db2expresscviper2. (You can even use this edition in production.)

Assuming you have configured your .NET development environment for DB2 (DB2 will take care of this automatically for you when you install the add-ins on a workstation where Visual Studio is already installed), when you start Visual Studio 2008 you should be able to see that the IBM Database Add-Ins for Visual Studio have been successfully registered:

Full article...

Other Related Articles

... to read more DBA articles, visit http://dba.fyicenter.com/article/