Madhawa Learns To Blog

.net, c#, sql, OOAD and more mad memory dumps...

Thursday, April 06, 2006

Using GenericDatabase class in EntLib for .net 2.0....?

In the previous Enterprise Library versions, it was necessary to have an Enterprise Library Database-derived class for every ADO.NET managed providers. So as we know there were Database classes for SQL Server, Oracle and DB2 But if we wanna use any other managed providers, we had to find or build our own Database class.

In Enterprise library for .net 2.0, there are SqlDatabase and OracleDatabase class and a new GenericDatabase class. The GenericDatabase can be used with any .NET managed provider including the ODBC and OLE-DB providers that coming with .NET. But there is a problem. That is it doesn’t support all of the functionality we got with SqlDatabase and OracleDatabase classes.

I’m gonna use GenericDatabase class ‘coz I could extend my application to use any DatabaseProvider in future. But the thing is I'm not sure what features I’ll lost because of this.
One disadvantage I know is the overloads that use parameter discovery do not work (since these methods aren’t supported on .NET’s DbConnection or DbCommand classes).
But we can build our own classes deriving Database class to support that functionality.

Anyway guys, if you have any experience on EntLib for .net 2.0 and have used GenericDatabase class, pls enlighten me on features we lost.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home