|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
aggregation simple .net codegreetings,
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 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 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 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 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 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/library/system.data.datarelation.childtable.aspx I hope this helps, Cor Show quoteHide quote "Dave Johnson" <esharpco***@gmail.com> schreef in bericht news:ON81TbpGGHA.3700@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
VB for .NET Recommended?
They do this in C# can't we do it in VB?? C DLL Callback to VB.NET 2005 vbexpress and sql2000 column subtotals in a datagrid Checking a string for filename compliance Moving a drawing Formatting the ComboBox editing window Crystal Report parameter dialog box SCOPE_IDENTITY() |
|||||||||||||||||||||||