Enterprise Library 2.0 & DB2

Topics: Data Access Application Block
Feb 20, 2007 at 3:11 PM
I am working on a project that will include a web app written in C#. We are planning on using Microsoft Enterprise Library 2.0 DAAB. We will be using SQL Server and DB2. I have found references to a separate project Data.DB2.csproj to use the DB2 Data Provider in Ent Lib 1.0 but can not find a similar project for 2.0. We tried to use the 1.0 DB2 project but had too many errors due to changes in the DB2 Data provider (9.0). Is there a DB2 project for 2.0 or do I need to create my own? Any help would be appreciated.
Feb 20, 2007 at 4:04 PM
Enterprise Library 2.0 has a GenericDatabase Class that works with DB2, so a separate class / project is not needed as it was in Enterprise Library 1.0.

The Documentation does a great job of talking about the removal of the DB2 specific class as well as the role of the GenericDatabase Class under the heading: Introduction to the Data Access Application Block.

Here is a snippet from the documentation:

"The DB2-specific DB2Database class no longer exists. Each Database-derived class in the application block (other than GenericDatabase) uses a specific ADO.NET provider. There is no DB2-specific ADO.NET 2.0 provider. However, the GenericDatabase class can be used with any managed ADO.NET provider, including the OLE-DB and ODBC providers which can be used to access many different kinds of databases."

I talk a little about using the Generic Database Class for Microsoft Access 2007 via its managed ADO.NET provider here:

Using Enterprise Library DAAB and Microsoft Access 2007 via ODBC and OLEDB - Connection Strings and ADO.NET

Regards,

Dave

________________________

David Hayden
Microsoft MVP C#

Apr 12, 2007 at 8:18 PM
We were not satisfied with GenericDatasbase, so we wrote our own DB2 provider that works for DB2 8.1 and DB2 9.x to effectively restore DB2 functionality to EL2. We wrote a DB2Database and DB2Assembler. Both depend on the IBM-supplied IBM.DB2.Data DLL's we downloaded for free from IBM's web site (version 9.1 if I recall correctly). We put both of them in a separate <<our company>>.Dataproviders project rather than pollute the original EL2. While we were at it, we created our own JetDatabase and JetDatabaseAssember modules to handle flat file and Excel file access. I can check to see if these are company proprietary and, if given permission, post them somewhere.
Apr 13, 2007 at 2:17 PM
That would be great. The reason we were interested in the Enterprise Library was to not have to build a lot of infrastructure. Thanks for your help.


fmorriso wrote:
We were not satisfied with GenericDatasbase, so we wrote our own DB2 provider that works for DB2 8.1 and DB2 9.x to effectively restore DB2 functionality to EL2. We wrote a DB2Database and DB2Assembler. Both depend on the IBM-supplied IBM.DB2.Data DLL's we downloaded for free from IBM's web site (version 9.1 if I recall correctly). We put both of them in a separate <<our company>>.Dataproviders project rather than pollute the original EL2. While we were at it, we created our own JetDatabase and JetDatabaseAssember modules to handle flat file and Excel file access. I can check to see if these are company proprietary and, if given permission, post them somewhere.

Jun 15, 2007 at 5:27 PM
Just wondering if you did post the code for the provider for DB2 for EL2 that you developed?
Thanks