473,722 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

aggregation simple .net code

greetings,

can any one show sample example of aggregation in any .net code vb.net
or C#

i guess it shouldnt be that hard but i searched a lot without finding
anything that explains the issue in code. please help!

Sharing makes All the Difference

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Jan 16 '06 #1
5 2121
Dave,

At least you will have to tell how you want to aggregate.

In it simplest form it is only looping through a collection of data and add
the fields that has to be aggregated.

Cor
Jan 16 '06 #2
Greetings Cor,

i have 2 classes first one is an Order Class and the 2nd one is an
Booking Class. the order Object consists of one or more booking objects

would u try to show aggregation on this example or in any other example.
i just wanna see some code to get the idea right noneed even to comment
it :)

thnx

Sharing makes All the Difference

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Jan 16 '06 #3
Dave,

Assuming that your Order has a collection of bookings, where in is a value

\\\
dim totalvalue as integer = 0
dim totalpersons as integer = 0
For each bk as booking in MyOrder.Booking Collection
totalvalue = bk.WhateverValu e
totalamount = bk.TotalPersons
next
///

I hope this helps,

Cor
Jan 16 '06 #4
thanks cor for your help, but just to make sure i wanna say it this way.

my making a collection of objects from one class into the another class,
i am making an aggregation relationship between the two classes
is this 100% right or am i missing somthing.

thanks again

Sharing makes All the Difference

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Jan 16 '06 #5
Dave,

I showed it you where the bookings are a collection in the order. It can of
course as well with by instance two datatables where the order is the Parent
from the booking or in other words the booking is one of the child of the
Order.

The code stays than almost the same, however you are iterating through the
childs.

To show you one link,

http://msdn2.microsoft.com/en-us/lib...hildtable.aspx

I hope this helps,

Cor

"Dave Johnson" <es*********@gm ail.com> schreef in bericht
news:ON******** ******@TK2MSFTN GP15.phx.gbl...
thanks cor for your help, but just to make sure i wanna say it this way.

my making a collection of objects from one class into the another class,
i am making an aggregation relationship between the two classes
is this 100% right or am i missing somthing.

thanks again

Sharing makes All the Difference

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Jan 16 '06 #6

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

Similar topics

5
3780
by: John Wood | last post by:
Let's say you're provided with an instance of a class. The instantiation takes place in another module that you have no control over. However, you've extended that class with your own value-added functionality. In C#, given such an instance, and a derived class, there's no way to 'attach' the instance to the class -- you have to either change the way the class was instantiated (not possible in this case), or wrap the class and delegate...
2
2626
by: Jozsef Bekes | last post by:
Hi, I would like to implement aggregation in C#, therefore I'd need to implement the queryinterface COM function of a class. I am not sure whether this can be done, and if yes where to start. If someone has an example, a hint or anything that might help, please share it with me. Thanks and Regards, Jozsi
4
14448
by: Frederik Vanderhaegen | last post by:
Hi, Can anyone explain me the difference between aggregation and composition? I know that they both are "whole-part" relationships and that composition parts are destroyed when the composition whole is destroyed. Under a "whole-part" relationship I understand the following: the whole can't exists without the parts, but can the parts exist without the hole? f.e.: a car can't exist without an engine private engine _Engine
5
2794
by: Nice Chap | last post by:
Aggregation in COM was defined as 'Exposing an interface of an inner object by the outer object as though it were an interface of the outer object'. Is this type of aggregation possible in vb.net( or c#).
23
2124
by: SenthilVel | last post by:
Hi Can any one let me know the websites/Pdf for learning Aggragation in C#?? Thanks Senthil
0
995
by: Dave Johnson | last post by:
greetings, can any one show sample example of aggregation in any .net code vb.net or C# i guess it shouldnt be that hard but i searched a lot without finding
1
1245
by: Dave Johnson | last post by:
greetings, can any one show sample example of aggregation in any .net code vb.net or C# i guess it shouldnt be that hard but i searched a lot without finding
1
2031
by: ninjutsu28 | last post by:
hi im juz a student so pls bear with my terminologies..juz wana ask how to perform aggregation in vb.net code.. in my model, i have rectangle, shape, drawing classes..rectangle class inherits shape class (is - a relationship), and drawing class has shape class(aggregation) Shape Class: Public MustInherit Class CShape Rectangle Class: Public Class CRectangle
2
14826
by: Gary Wessle | last post by:
Hi what is the difference "in code writing" between aggregation and composition? is the following correct? aggregation (life time of both objects are independent). class A{ /* ... */ }; class B{ A& a; /* ... */};
0
8860
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9234
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9151
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9086
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6680
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2146
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.