scm0sml
asked on
list(of object) vs IEnumerable(Of Object)
Hi,
I have always used list(of customobject).
Can someone tell me what the difference is between that and Ienumrable(of customobject) and how they would be used differently?
Have just upgraded to .net for using vb.net and would like to make sure i am still using the right thing.
Thanks
I have always used list(of customobject).
Can someone tell me what the difference is between that and Ienumrable(of customobject) and how they would be used differently?
Have just upgraded to .net for using vb.net and would like to make sure i am still using the right thing.
Thanks
The List implements IEnumerable interface.
ASKER
so basically list is fine unless there is a large amount of data being returned...as in huge?!
Holding a huge collection (of any type) of custom objects in memory is not a good idea anyway.
ASKER
so if i wanted to pull them out of a db and display them on a page I would use...........?
DataTable.
ASKER
so if i am using oo'd approach....
rather than have maybe a loadall() that returned a list of objects, you would still use a datatable?
rather than have maybe a loadall() that returned a list of objects, you would still use a datatable?
That really depends. In my projects, even though I am using LINQ to SQL, I use stored procedures and datatables for showing lists of objects.
ASKER
mmmm
I'm using n-tier so will return list of objects from my business layer.
Is there an industry standard these days?
I'm using n-tier so will return list of objects from my business layer.
Is there an industry standard these days?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Riight ok great thanks for all your input.
Glad to help :-)
http://stackoverflow.com/questions/1211491/c-listt-vs-ienumerablet-performance-question