Pieter,
Assuming that you mean with classes instanced objects, than in my opinion is
your class on the same level as the arraylist or whatever.
And therefore is in my opinion just a for loop from the datatable, something
as
Dim myarraylist as new arraylist
For each row as datarow in myDatatable
dim myObject as new myClassBeNeLux
MyObject.TheCountry = col("Country")
if MyObject.TheCountry = "Belgium" then
MyObject.CorrectRoute = "Probably false"
end if
Next
In my opinion you cannot do it quicker using reflection or something what
you maybe expect You can maybe make a shorter routine using that, however
the processing time will probably be longer. You know something the same as
directing almost everybody except the first over a wrong route.
:-)
Cor
"DraguVaso" <pi**********@hotmail.com> schreef in bericht
news:uF**************@tk2msftngp13.phx.gbl...
Hi,
I want a fast way to use assign a tha values in a DataTable to a
collection/Array/List of Classes. Each record in my DataTable should be
new
Class, and tha Class would have property's for each Field in the
DataTable.
Is something like this possible? Or how should I do something like this?
A more practical exemple:
I have a Class clsCustomer, which contains many orders: so a
Collection/Array/List of the clsOrder.
So with the CustomerID, I want to have the whole Collection/Array/List of
the clsOrder of this Customer...
Thanks a lot in advance,
Pieter