473,396 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1515
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
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
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
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
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
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
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
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
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
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.