Home All Groups Group Topic Archive Search About

deriving enterpriselibrary.data.database

Author
20 Apr 2006 7:17 PM
RMB
I have a class that I want to derive from enterpriselibrary.data.database.  I
want to open the database connection on the base class, but I have hit a road
block as to how I can retrieve the connectionstring from dataConfiguration,
and assign it to the base to open the connection. 

Normally with the DAAB you call DatabaseFactory.CreateDatabase, but I do not
want to propagate this call everywhere, and I want to take advantage of the
existing methods of the base database class, and extend where I need to.

Should I even try to derive from the data.database?  Should I derive from
the more specific data.sql.sqldatabase or data.oracle.oracledatabase?  Should
I just set a private member variable for the database object and call
DatabaseFactory.CreateDatabase?

Any help/enlightenment is appreciated.

Below is a sample of the code:

Public Class Instance : Inherits
Microsoft.Practices.EnterpriseLibrary.Data.Database
        Implements IDisposable

        Public Sub New(ByVal db As String)
            MyBase.New()

            'Open database on base class here
            MyBase.?????
        End Sub
#End Region

AddThis Social Bookmark Button