473,480 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Extending Component Class

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.
Jul 21 '05 #1
3 1519
Have you actually compiled the BaseDAO before you created the sub-class ?

Angel
O:]

"pantichd" <pa******@firstenergycorp.com> wrote in message
news:uk**************@TK2MSFTNGP15.phx.gbl...
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.

Jul 21 '05 #2
Yes, the base class compiled fine. So did the child class.

The error happens when I try to open the Designer on the child class.

Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
When working with a custom component/control in the designer, you need to
build a design version and a reun-time version of the obejct.

Here is a link overviewing the process.

http://msdn.microsoft.com/library/de...log_editor.asp

Hope it helps.

--tpt

"David Pantich" wrote:
Yes, the base class compiled fine. So did the child class.

The error happens when I try to open the Designer on the child class.

Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3415
by: Matt | last post by:
Hi, I've been thinking about how to do this, but can't think of a solution. I have a class that is derived from System.Web.UI.WebControls.DataGrid which works a treat, but I'd like to extend...
2
2417
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
4
307
by: pantichd | last post by:
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...
0
2066
by: Brian Henry | last post by:
I thought this was useful, its a extender i just wrote for the new .NET menu strip and status strip to extend the menu items to add a status message so when a mouse rolls over the item it displays...
3
7664
by: Richard Bysouth | last post by:
Hi In my app I'm using a BackgroundWorker component to execute a long-running task - updating a progress on my form fine. However, I'd like to provide more information to that form while the...
5
3814
by: vbgunz | last post by:
Hello everyone. I own two books. Learning Python and Python in a nutshell. When cross referencing the two books to try and clarify the ideas behind extending methods and delegates, this is where...
9
5766
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender,...
122
7201
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
13
2095
by: interec | last post by:
I have some code in Java that I need to translate into C++. My Java code defines a class hierarchy as follows: // interface IA public interface IA { public abstract void doA(); } //...
0
7043
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7081
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6921
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5336
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4776
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.