Architectural Question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: pantichd (pantichd_at_firstenergycorp.com)
Date: 10/22/04


Date: Fri, 22 Oct 2004 12:54:32 -0400

Hello,

I'm using a Component Class object to represent a database table. This Data Access Object (DAO) has a connection object and data adapter object in it along with a bunch of methods that need to be there every time I create a new DAO to represent a db table.

Instead of having to code that "common" logic for each new class I'd like to create a base DAO, put the common logic there and inherit from it (instead of System.ComponentModel.Component) for each new DAO.

My current steps for creating a new DAO are:
1) Create a new Component Class object
2) Drag the database from the Server Explorer onto the design pane. This creates the connection object to the db.
3) Drag a table from the database in Server Explorer onto the design pane. This creates the data adapter object for that table.
4) Create all the common methods in the new DAO

Within an application, each DAO will have the exact same connection object so I'd like to include that in the base DAO.

Thinking along those lines, I created a new DAO (call it BaseDAO) and did steps 1, 2 & 4 from above. Then I created another DAO (ChildDAO) that inherits from the BaseDAO. I was hoping that I would then be able to just do step 3 from above for this new DAO.

When I try to bring up the designer for ChildDAO I get the following error:

   The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file:

   ChildDAO --- The base class 'LayerDataAccess.BaseDAO' could not be loaded. Ensure the assembly has been referenced or built if it is part of the project.

Both the BaseDAO and ChildDAO objects are in the same project. Does anyone have any ideas what I'm doing wrong?

Thanks in advance for any help.

David.



Relevant Pages

  • Re: ADO and the Find method
    ... You cannot compare DAO and ADO. ... database, which has OLEDB provider. ... >>>> Opening of the whole table was not a good design anytime. ...
    (microsoft.public.vb.database.ado)
  • Saving design changes in Access 2000 locks out ADO, why?
    ... I have Access 2000 with some DAO and some ADO code. ... If I make any design ... I must close and re-open the database to run any ADO ...
    (microsoft.public.access.queries)
  • how to access a db table that changes structure
    ... Hello all, I've a database table that can change structure, think about ... I have to design some classes to access the database, ... a "normal" DAO, because sometimes in the future there will be new ...
    (comp.lang.java.databases)
  • Re: Import Text with existing schema.ini file utility
    ... the database engine looks for schema.ini. ... As far as I know it's not possible to specify schema.ini in SQL; ... DAO is specifically designed to work with the Jet ... >> oDB.Execute strSQL ...
    (microsoft.public.access.modulesdaovba)
  • Re: Run action query in back-end from front-end database
    ... whatnot in the back end database. ... The queries are housed in the back end ... The reason I have the upload tables in the back end is that it will be on ... Rick's code uses DAO, and Access 2000 doesn't have a reference set by ...
    (microsoft.public.access.externaldata)