473,378 Members | 1,438 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,378 software developers and data experts.

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 2103
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.BookingCollection
totalvalue = bk.WhateverValue
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*********@gmail.com> schreef in bericht
news:ON**************@TK2MSFTNGP15.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
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...
2
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...
4
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...
5
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(...
23
by: SenthilVel | last post by:
Hi Can any one let me know the websites/Pdf for learning Aggragation in C#?? Thanks Senthil
0
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
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
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...
2
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{ /* ... */ };...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.